Re: Unexpected sequence scan

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Dan Fairs" <dan(dot)fairs(at)gmail(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Unexpected sequence scan
Date: 2012-05-04 14:40:32
Message-ID: 4FA3A410020000250004787C@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Dan Fairs <dan(dot)fairs(at)gmail(dot)com> wrote:

> I have a query which is running slowly, and the query plan shows
> an unexpected sequence scan where I'd have expected the planner to
> use an index.

Looking at the actual row counts compared to run time, it appears
that the active portion of your data set is heavily cached. In such
an environment, I would add these lines to postgresql.conf, to
better model costs:

seq_page_cost = 0.1
random_page_cost = 0.1 # or maybe slightly higher
cpu_tuple_cost = 0.03

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2012-05-04 14:43:19 Re: Unexpected sequence scan
Previous Message Dan Fairs 2012-05-04 14:24:33 Unexpected sequence scan