| From: | "Henry Combrinck" <henry(at)metroweb(dot)co(dot)za> | 
|---|---|
| To: | "Stephan Szabo" <sszabo(at)megazone(dot)bigpanda(dot)com> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: SOLVED: Where clause limited to 8 items? | 
| Date: | 2004-10-20 06:58:04 | 
| Message-ID: | 15256.168.210.90.180.1098255484.squirrel@airmail.metroweb.co.za | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
>
> Check the estimated number of rows returned.  It's presumably believing
> that the a sequential scan will be cheaper for the estimated number of
> rows.
>
> If the estimated number of rows is significantly off, you may wish to
> change the statistics target (see ALTER TABLE) for col1 and analyze the
> table again.
>
> If it still is choosing a sequential scan over an index scan and the
> number of rows is similar, you may want to look at the "random_page_cost"
> variable.  You have to be careful not too lower it too far that other
> queries are pessimized the other direction, but some experimentation
> comparing the real times and estimated costs of queries with and without
> enable_seqscan=off may help.
Thanks for the detailed response! Your suggestion was spot-on.
Regards
Henry
--------------------------------------------------------
This message was sent using MetroWEB's AirMail service.
http://www.metroweb.co.za/ - full access for only R73.
Free Web Accelerator, WebMail, Calendar, Anti-Virus, 
Anti-Spam, 10 emails, 100MB personal webspace, and more!
Phone Now!  086 11 11 440
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Gary Doades | 2004-10-20 07:00:55 | Re: how much ram do i give postgres? | 
| Previous Message | Greg Stark | 2004-10-20 06:05:44 | Re: Where clause limited to 8 items? |