On Wed, 5 Nov 2003, Rod Taylor wrote:
> Since this is a large query, attachments for the explains / query.
>
> Configuration:
> dev_iqdb=# select version();
> version
> ------------------------------------------------------------------------
> PostgreSQL 7.4beta1 on i386-portbld-freebsd4.7, compiled by GCC
> 2.95.4
> (1 row)
>
> SET default_statistics_target = 1000;
> ANALYZE;
> set from_collapse_limit = 100;
> set join_collapse_limit = 20;
I'm not sure if that will actually change the default_statistics_target of
the tables you're analyzing, I think it will only apply to newly created
tables.
I believe you have to alter table alter column set statistics 1000 for
each column you want a statistic of 1000. You might wanna try starting
with 50 or 100 and see if that works first.