Re: How to inject knowledge into a Postgres database - Mailing list pgsql-general

From Tom Lane
Subject Re: How to inject knowledge into a Postgres database
Date
Msg-id 21051.1129212380@sss.pgh.pa.us
Whole thread Raw
In response to Re: How to inject knowledge into a Postgres database  (han.holl@informationslogik.nl)
Responses Re: How to inject knowledge into a Postgres database  (han.holl@informationslogik.nl)
List pgsql-general
han.holl@informationslogik.nl writes:
> I've increased the statistics to 1000, and only occasionally, because of the
> very uneven distribution of surnames, the planner does the wrong thing.
> I've tried to set an even higher limit, but 1000 seems to be the maximum.
> Is this hardcoded, or can I set a higher maximum somewhere ?

You'd have to change the source code, but it's a simple tweak in the
ALTER SET STATISTICS code.

> If the only penalty is slower analyzing, I don't care: we analyze at night
> when these system are idle.

You'd be wrong about that --- the planner operations that use the data
would necessarily be slower, too.  I don't have any concrete information
about how much slower, but I'd be hesitant to raise the figure much
beyond 1000 ...

However, if you can show you have a real-world case that benefits, I'd
be willing to think about raising the wired-in limit to 10000 or so.

            regards, tom lane

pgsql-general by date:

Previous
From: H Hale
Date:
Subject: binary timestamp conversion
Next
From: cadiolis@gmail.com
Date:
Subject: Text->Date conversion in a WHERE clause