suggestion: set default statistics to 100 for numerics

Started by Joseph Shraibmanover 21 years ago3 messages
#1Joseph Shraibman
jks@selectacast.net

Seeing how small storage for a number type is compared to a text type,
and seeing how they tend to be queried on a lot, shouldn't it be
reasonable for the default stats number for numerics to be 100 instead
of 10?

#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Joseph Shraibman (#1)
Re: suggestion: set default statistics to 100 for numerics

On Wed, Jun 30, 2004 at 10:56:53PM -0400, Joseph Shraibman wrote:

Seeing how small storage for a number type is compared to a text type,
and seeing how they tend to be queried on a lot, shouldn't it be
reasonable for the default stats number for numerics to be 100 instead
of 10?

The problem is not only storage space, but also the optimizer runtime;
which would have to munge the larger amount of data ... not sure if this
is critical but enlarging it by default for all numeric columns may not
be desirable.

Anyway ISTM a better rule would be enlarging the default stats number
for columns that are part of an index, rather than using the datatype.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Porque Kim no hacia nada, pero, eso s�,
con extraordinario �xito" ("Kim", Kipling)

#3Joseph Shraibman
jks@selectacast.net
In reply to: Alvaro Herrera (#2)
Re: suggestion: set default statistics to 100 for numerics

Alvaro Herrera wrote:

On Wed, Jun 30, 2004 at 10:56:53PM -0400, Joseph Shraibman wrote:

Seeing how small storage for a number type is compared to a text type,
and seeing how they tend to be queried on a lot, shouldn't it be
reasonable for the default stats number for numerics to be 100 instead
of 10?

The problem is not only storage space, but also the optimizer runtime;
which would have to munge the larger amount of data ... not sure if this
is critical but enlarging it by default for all numeric columns may not
be desirable.

I don't think the optimizer run time is that much longer in absolute
terms. The only reason I suggest it is that even experienced postgres
users probably don't think about this often enough

Anyway ISTM a better rule would be enlarging the default stats number
for columns that are part of an index, rather than using the datatype.

That has merit too, but I think text fields are queried on and indexed
less and would take up much more room in the stats table.