Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by postgresql.org (Postfix) with ESMTP id 9CBB04759BB for ; Mon, 22 Apr 2002 13:25:53 -0400 (EDT) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.9.3/8.9.3/Debian 8.9.3-21) with SMTP id MAA02408; Mon, 22 Apr 2002 12:25:48 -0500 X-Authentication-Warning: shire.ontko.com: Host bilbo.ontko.com [199.164.165.101] claimed to be nick Reply-To: From: "Nick Fankhauser" To: "Tom Lane" Cc: "pgsql-admin" Subject: Re: An Analyze question Date: Mon, 22 Apr 2002 12:24:27 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal In-Reply-To: <16789.1019494600@sss.pgh.pa.us> X-Archive-Number: 200204/201 X-Sequence-Number: 4089 > 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