Re: An Analyze question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nickf(at)ontko(dot)com
Cc: "pgsql-admin" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: An Analyze question
Date: 2002-04-22 17:40:21
Message-ID: 17407.1019497221@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Nick Fankhauser" <nickf(at)ontko(dot)com> writes:
> The "Before" database:

> attname | attdispersion | starelid | staattnum | staop |
> stanullfrac | stacommonfrac | stacommonval | staloval |
> stahival
> --------------------------+---------------+----------+-----------+-------+--
> -----------+---------------+---------------+-----------------------------+--
> ---------------------
> actor_id | 0.00761992 | 2591915 | 1 | 1066 |
> 0 | 0.0335872 | JTW | 18105A08315 49 | XS

> The "After" database:

> attname | attdispersion | starelid | staattnum | staop |
> stanullfrac | stacommonfrac | stacommonval | staloval
> | stahival
> --------------------------+---------------+----------+-----------+-------+--
> -----------+---------------+--------------------+---------------------------
> -+-----------------------
> actor_id | 0.03247 | 33979335 | 1 | 1066 |
> 0 | 0.112092 | 18105XS | 18105A |
> 18105XS

Hm. In the "before" case you are showing JTW as the most common
actor_id, with a frequency of 3.36% of the entries (busy judge,
I suppose).

In the "after" case you are showing "18105XS" as the most common
actor_id, with a frequency of 11.2% of the entries. Where'd that
come from? Is it correct?

The change in plans occurs because of the increase in stacommonfrac.
7.1 basically uses stacommonfrac as the selectivity estimate if the
constant is the stacommonval, otherwise stacommonfrac/10. So if
stacommonfrac goes up, so does the estimated number of rows retrieved,
and that's what's changing your plan.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Denny-Schierz 2002-04-22 17:42:46 Linux user www-data has no access to amphora2 DB_New
Previous Message Denny-Schierz 2002-04-22 17:32:59 Linux user www-data has no access to amphora2 DB