Re: index vs. seq scan choice?

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: George Pavlov <gpavlov(at)mynewplace(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: index vs. seq scan choice?
Date: 2007-06-07 22:01:51
Message-ID: 4668804F.6090201@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-www

George Pavlov wrote:
>> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
>> "George Pavlov" <gpavlov(at)mynewplace(dot)com> writes:

> to 977ms! If I go the other way and SET STATISTICS 1 (or 0) I can bring
> down the list to one entry (setting to 0 seems equivalent and still
> keeps the one most common entry!?) and I will get the Index scan for all
> states except for that one most common state. But, of course, I don't
> want to undermine the whole stats mechanism, I just want the system to
> use the index that is so helpful and brings runtimes down by a factor of
> 4-8! What am I missing here?

In those rare cases wouldn't it make more sense to just set
enable_seqscan to off; run query; set enable_seqscan to on;

??

Joshua D. Drake

>
> George
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>

--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-06-07 22:08:20 Re: subtract a day from the NOW function
Previous Message Michael Glaesemann 2007-06-07 21:58:03 Re: subtract a day from the NOW function

Browse pgsql-www by date

  From Date Subject
Next Message George Pavlov 2007-06-07 22:21:14 Re: index vs. seq scan choice?
Previous Message George Pavlov 2007-06-07 21:56:06 Re: index vs. seq scan choice?