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:29:44
Message-ID: 466886D8.2070901@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-www

George Pavlov wrote:
>> 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);

I find that surprising.

>
> 2. setting enable_seqscan (in JDBC, say) from the application makes the
> whole thing quite a mess (need to do a batch of statements: each query
> wrapped in its enable/disable seq scan?) -- ideally, one would like to
> issue mostly SQL statements, not config parameters from the application;

Uh no. You do it at the beginning of the transaction, run your queries
then reset it right before (or after) commit.

>
> 3. if this is the recommended suggestion on how to run queries then why
> don't we just add HINTS to the system and be done with it...

I suggest you read the archives, twice, before suggesting hints.

>
>
>
>

--

=== 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 Tom Lane 2007-06-07 22:33:48 Re: index vs. seq scan choice?
Previous Message George Pavlov 2007-06-07 22:21:14 Re: index vs. seq scan choice?

Browse pgsql-www by date

  From Date Subject
Next Message Alvaro Herrera 2007-06-07 22:33:35 Re: [DOCS] Users comments don't migrate to docs for new version?
Previous Message George Pavlov 2007-06-07 22:21:14 Re: index vs. seq scan choice?