From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Oleg Lebedev <olebedev(at)waterford(dot)org> |
Cc: | Postgres SQL Mailing List <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: won't drop the view |
Date: | 2001-12-27 04:54:00 |
Message-ID: | 22873.1009428840@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Oleg Lebedev <olebedev(at)waterford(dot)org> writes:
> select attname, attdispersion, s.*
> from pg_statistic s, pg_attribute a, pg_class c
> where starelid = c.oid and attrelid=c.oid and staattnum=attnum and relname='activity';
> attname | attdispersion | starelid | staattnum | staop | stanullfrac | stacommonfrac | stacommonval | staloval | stahival
> -------------------------+---------------+----------+-----------+-------+-------------+---------------+--------------------------------------+-------------+------------------------------
> productcode | 0.002625 | 14559105 | 17 | 1066 | 0 | 0.0125 | m3nt22 | 0000 | t3nt15
Well, I can see that 7.1 wouldn't be likely to make a good estimate
about the selectivity of productcode ~ '^m3' on this table; it doesn't
take stacommonval into account (and that's only 1% of the table anyway),
and the range '0000' .. 't3nt15' is too wide to make it plausible that
m3's take up 98% of the table. I believe 7.2 will do better though.
Care to try out your database with a beta version?
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Rowell | 2001-12-27 05:36:05 | Multiple counts |
Previous Message | Oleg Lebedev | 2001-12-27 01:48:32 | Re: won't drop the view |