pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Zhang, Anna <azhang@verisign.com>
Cc: Pgsql-Admin (E-mail) <pgsql-admin@postgresql.org>
Subject: Re: optimizer
Date: Wed, 27 Feb 2002 14:55:27 -0800 (PST)
Message-ID: <20020227145230.D8222-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <5511D658682A7740BA295CCF1E1233A635A861@vsvapostal2.bkup3>


On Wed, 27 Feb 2002, Zhang, Anna wrote:

>
> >Is the estimate above (1.5M rows) reasonable?  If so, it's probably
> >doing the right thing.  If not, what version are you using and are
> >there any very common values that may throw off the estimates; what
> >does select * from pg_statistic where starelid=(select oid from
> >pg_class where relname='domain'); give?

Okay, does running it after set enable_seqscan=false; actually run faster
than the sequence scan version?

> select * from pg_statistic where starelid=(select oid from pg_class where
> relname='domain');
>
> starelid  | staattnum | staop | stanullfrac | stacommonfrac |
> stacommonval        |           staloval           |
>
>     stahival
> -----------+-----------+-------+-------------+---------------+--------------
> --------------+------------------------------+------------------------------
> -----------------------------------
> 749413081 |         1 |   664 |           0 |   7.02145e-08 | UPSPWR-DOM
>
>              | 000000000000000000000-N3-DOM | ZZZZZZZZZZZZZZZZZZZZZ9-DOM
> 749413081 |         2 |   664 |           0 |   7.02145e-08 | UPSPWR
>
>              | 00                           |
> ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
> 749413081 |         3 |   664 |           0 |      0.728349 | COM
>
>              | ARPA                         | WS
> 749413081 |         4 |   664 |           0 |      0.107595 | NAMEZERO.COM
>
>              | `                            |    ambassador blinds
> 749413081 |         5 |   664 |           0 |      0.107594 | 51 University
> Ave, Suite K | -                            | zzzzzzzzzzzzzzzzzz
> zzzzzzzzzzzzzzzz, zzzzzzzzzzz 325698
> 749413081 |         6 |   664 |    0.312378 |      0.107716 | LOS GATOS
>
>              | -                            |  Murray
> 749413081 |         7 |   664 |    0.312378 |      0.227842 | CA
>
>              | AA                           | WY
> 749413081 |         8 |   664 |    0.312119 |      0.107774 | 95030
>
>              | 00005                        | 99995
> 749413081 |         9 |   664 |  0.00980173 |      0.687646 | US
>
>              | AC                           | ZW
> (9 rows)
>
> The column holdername is not common, same holdername may have a few records.
> I am running postgres 7.2, for pg_statistic table I really no idea what each

Are you *sure* this is a 7.2 server?  The above looks like the form from
7.1 and earlier.  In any case, it looks like NAMEZERO.COM is the most
common value with about 10% of the table, so I don't think sequence scan
is a bad plan necessarily.




view thread (4+ messages)

Message-ID: <20020227145230.D8222-100000@megazone23.bigpanda.com>
Permalink:  ../20020227145230.D8222-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020227145230.D8222-100000@megazone23.bigpanda.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: sszabo@megazone23.bigpanda.com, azhang@verisign.com
  Subject: Re: optimizer
  In-Reply-To: <20020227145230.D8222-100000@megazone23.bigpanda.com>
  References: <5511D658682A7740BA295CCF1E1233A635A861@vsvapostal2.bkup3> <20020227145230.D8222-100000@megazone23.bigpanda.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