pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nick Fankhauser <nickf@ontko.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: An Analyze question
Date: Mon, 22 Apr 2002 12:24:27 -0500
Message-ID: <NEBBLAAHGLEEPCGOBHDGKEDOENAA.nickf@ontko.com> (raw)
In-Reply-To: <16789.1019494600@sss.pgh.pa.us>


> 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 = 'actor_case_assignment';
>
> in each database?
Here are the results:


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
 case_id                  |    1.4583e-05 |  2591915 |         2 |  1066 |
0 |   7.28935e-05 | 501CP00243    | 02145556                    | YW02647802
 assigned_case_role       |      0.100296 |  2591915 |         6 |  1066 |
0.000108355 |      0.250493 | DEFENDANT     | Attorney                    |
THIRD PARTY PLAINTIFF
 actor_case_assignment_id |            -1 |  2591915 |        17 |  1066 |
0 |   9.85048e-07 | X693CF00396-S | 18105A100DF00438-S-17369 53 | XTV8605
685E-S
(4 rows)



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
 case_id                  |   1.22202e-05 | 33979335 |         2 |  1066 |
0 |    6.1086e-05 | 18105498CP01613    | 1810502145556              |
18105YW02647802
 assigned_case_role       |     0.0575305 | 33979335 |         6 |  1066 |
0.000108378 |      0.170868 | Attorney           | Attorney
| THIRD PARTY PLAINTIFF
 actor_case_assignment_id |            -1 | 33979335 |        17 |  1066 |
0 |   9.85259e-07 | 18105X202CM01929-S | 18105A100CF00018-1-7888 53 |
18105XTV8605 685E-S
(4 rows)


> Are you really comparing apples to apples here?

You're correct, but in this case the plans are the same if I use the value
you suggest. The value I'm searching for is not a common one, so presumably,
I'm getting the dispersion for a value that isn't the "most-common-value".

The records in this table fall into three categories generally:

Judges that have ten thousands of cases-
Attorneys that have thousands of cases-
Average Joes who have one or two cases-

This means that a typical actor_id will have one record, but the average is
probably about 2000.

Thanks!

-Nick




view thread (9+ messages)  latest in thread

Message-ID: <NEBBLAAHGLEEPCGOBHDGKEDOENAA.nickf@ontko.com>
Permalink:  ../NEBBLAAHGLEEPCGOBHDGKEDOENAA.nickf@ontko.com/
Also on:    postgresql.org/message-id/NEBBLAAHGLEEPCGOBHDGKEDOENAA.nickf@ontko.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: nickf@ontko.com, tgl@sss.pgh.pa.us
  Subject: Re: An Analyze question
  In-Reply-To: <NEBBLAAHGLEEPCGOBHDGKEDOENAA.nickf@ontko.com>
  References: <16789.1019494600@sss.pgh.pa.us> <NEBBLAAHGLEEPCGOBHDGKEDOENAA.nickf@ontko.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox