By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,903 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,903 IT Pros & Developers. It's quick & easy.

pg_stats question

P: n/a
I notice in 7.4.1 that if I do:
ALTER TABLE <tab> ALTER <col> SET STATISTICS 100;
.... that not necc. 100 values are stored in pg_stats, but in 7.3.4 it
did. Bug or expected behaviour?

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Joseph Shraibman <jk*@selectacast.net> writes:
I notice in 7.4.1 that if I do:
ALTER TABLE <tab> ALTER <col> SET STATISTICS 100;
... that not necc. 100 values are stored in pg_stats, but in 7.3.4 it
did. Bug or expected behaviour?


It wasn't necessarily 100 values in 7.3, either.

As a trivial counterexample, if you have less than 100 distinct values
in your column, there definitely won't be 100 values in the
most-common-values list ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #2

P: n/a
Tom Lane wrote:
Joseph Shraibman <jk*@selectacast.net> writes:
I notice in 7.4.1 that if I do:
ALTER TABLE <tab> ALTER <col> SET STATISTICS 100;
... that not necc. 100 values are stored in pg_stats, but in 7.3.4 it
did. Bug or expected behaviour?

It wasn't necessarily 100 values in 7.3, either.

As a trivial counterexample, if you have less than 100 distinct values
in your column, there definitely won't be 100 values in the
most-common-values list ...

Right, but in this case I'm sure I have over 200 values.

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #3

P: n/a
Joseph Shraibman <jk*@selectacast.net> writes:
Tom Lane wrote:
As a trivial counterexample, if you have less than 100 distinct values
in your column, there definitely won't be 100 values in the
most-common-values list ...
Right, but in this case I'm sure I have over 200 values.


Still, ANALYZE might not have seen all of them within its sample set of
rows. There's inherently some sampling error involved in the process
(at least in 7.2 and later).

I don't believe 7.4 has any significant difference from 7.3 in this
area.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.