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@postgresql.org' <pgsql-admin@postgresql.org>
Subject: Re: optimizer
Date: Wed, 27 Feb 2002 14:14:33 -0800 (PST)
Message-ID: <20020227140841.Y7484-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <5511D658682A7740BA295CCF1E1233A635A85F@vsvapostal2.bkup3>

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

> Hi,
> I have a table named Domain that has 14M rows, here is the defination:
>
> xdap_regr=# \d domain
>          Table "domain"
>   Attribute   | Type | Modifier
> -----------------+-------+----------
> domainhandle 	| text | 	not null
> domainname   	| text | 	not null
> parentdomain 	| text | 	not null
> holdername   	| text |
> street       	| text |
> city        	| text |
> state        	| text |
> postalcode   	| text |
> country      	| text |
> Indices: idx_domain_domainname,
>             idx_domain_holdername,
>             idx_domain_parentdoamin,
>             pk_domain
>
> An index on holdname has been created and the table analized.
>
> xdap_regr=# explain select domainname from domain where holdername =
> 'NAMEZERO.COM';
> NOTICE:  QUERY PLAN:
>
> Seq Scan on domain  (cost=0.00..483192.89 rows=1532369 width=12)

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?

> Can we force optimizer to index scan?
set enable_seqscan=off;





view thread (4+ messages)  latest in thread

Message-ID: <20020227140841.Y7484-100000@megazone23.bigpanda.com>
Permalink:  ../20020227140841.Y7484-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020227140841.Y7484-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: <20020227140841.Y7484-100000@megazone23.bigpanda.com>
  References: <5511D658682A7740BA295CCF1E1233A635A85F@vsvapostal2.bkup3> <20020227140841.Y7484-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