From: | Mark Kirkwood <markir(at)coretech(dot)co(dot)nz> |
---|---|
To: | Ragnar Hafstað <gnari(at)simnet(dot)is> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Postgres Optimizer is not smart enough? |
Date: | 2005-01-13 02:11:12 |
Message-ID: | 41E5D8C0.5080304@coretech.co.nz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Ragnar Hafstað wrote:
>
>
>
> it is not rational to have random_page_cost < 1.
>
I agree, in theory one should never *need* to set it < 1. However in
cases when the optimizers understanding of things is a little off,
compensation may be required to achieve better plans (e.g. encouraging
index scans on data with funny distributions or collelations).
> if you see improvement with such a setting, it is as likely that
> something else is wrong, such as higher statistic targets needed,
> or a much too low effective_cache setting.
>
Altho this is good advice, it is not always sufficient. For instance I
have my effective_cache_size=20000. Now the machine has 512Mb ram and
right now cache+buf+free is about 100M, and shared_buffers=2000. So in
fact I probably have it a bit high :-).
Increasing stats target will either make the situation better or worse -
a better sample of data is obtained for analysis, but this is not
*guaranteed* to lead to a faster execution plan, even if in
general/usually it does.
cheers
Mark
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2005-01-13 02:39:33 | Re: Postgres Optimizer is not smart enough? |
Previous Message | Greg Sabino Mullane | 2005-01-13 01:28:32 | Re: PostgreSQL vs. Oracle vs. Microsoft |