From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Christopher Browne <cbbrowne(at)acm(dot)org> |
Cc: | pgsql-admin(at)postgresql(dot)org |
Subject: | Re: R: R: slow seqscan after vacuum analize |
Date: | 2004-02-05 17:09:49 |
Message-ID: | 4193.1076000989@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Christopher Browne <cbbrowne(at)acm(dot)org> writes:
> Another factor worth considering: If a few values are very common in
> the field you are selecting on, then the query optimizer can get
> convinced (wrongly) that a Seq Scan is the best choice. Using ALTER
> TABLE T ALTER COLUMN C SET STATISTICS [some value] to increase the
> number of "bins" can be helpful in such cases. (My pet theory is that
> the present default value of 10 is a little low, and that a lot of
> optimizer errors might be resolved by bumping it up a bit...)
I also suspect that 10 is a lowball figure, but no one has done any work
to establish what might be a more reasonable default. Larger values
have real costs in both pg_statistic space and planner runtime, so I
don't want to push it up without some kind of evidence.
BTW, if you think a higher default might be appropriate, you can set it
in postgresql.conf instead of running around and manually ALTERing all
your tables.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Sam Barnett-Cormack | 2004-02-05 17:22:32 | Re: VACUUM Quesition |
Previous Message | Stefan Sturm | 2004-02-05 17:08:07 | VACUUM Quesition |