Re: won't drop the view - Mailing list pgsql-sql

From Tom Lane
Subject Re: won't drop the view
Date
Msg-id 22873.1009428840@sss.pgh.pa.us
Whole thread Raw
In response to Re: won't drop the view  (Oleg Lebedev <olebedev@waterford.org>)
List pgsql-sql
Oleg Lebedev <olebedev@waterford.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


pgsql-sql by date:

Previous
From: Oleg Lebedev
Date:
Subject: Re: won't drop the view
Next
From: Richard Rowell
Date:
Subject: Multiple counts