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:59:06
Message-ID: 46688DBA.7000800@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-www

George Pavlov wrote:
>> From: Tom Lane
>> "George Pavlov" <gpavlov(at)mynewplace(dot)com> writes:
>>>> From: Joshua D. Drake [mailto:jd(at)commandprompt(dot)com]
>>>> In those rare cases wouldn't it make more sense to just set
>>>> enable_seqscan to off; run query; set enable_seqscan to on;
>>> 1. these cases are not that rare (to me);
>> It strikes me that you probably need to adjust the planner cost
>> parameters to reflect reality on your system. Usually dropping
>> random_page_cost is the way to bias the thing more in favor of
>> index scans.
>
> Thanks, Tom, I will try that. Seems better than fiddling with
> enable_seqscan around every query/transaction.
>
> Joshua, I fail to understand why setting and unsetting enable_seqscan on
> a per query/transaction basis is in any way preferable to query hints?
> Don't get me wrong, I don't like the idea of hints, and I have read the
> archives on the subject and I agree with the philosophy, but if the
> optimization toolkit for routine application queries is going to include
> setting config parameters that just smacks of hints by another name...

I actually have zero opinion on hints, my comment was more about opening
the wasps nest of the hints discussion more than anything :)

Joshua D. Drake

>
> George
>

--

=== 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

Browse pgsql-general by date

  From Date Subject
Next Message Guy Rouillier 2007-06-07 23:31:53 Re: Creditcard Number Security was Re: Encrypted column
Previous Message George Pavlov 2007-06-07 22:52:16 Re: index vs. seq scan choice?

Browse pgsql-www by date

  From Date Subject
Next Message Andrej Ricnik-Bay 2007-06-07 23:24:09 Re: [pgsql-www] Users comments don't migrate to docs for new version?
Previous Message George Pavlov 2007-06-07 22:52:16 Re: index vs. seq scan choice?