Re: optimizer

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Zhang, Anna" <azhang(at)verisign(dot)com>
Cc: "'pgsql-admin(at)postgresql(dot)org'" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: optimizer
Date: 2002-02-27 22:14:33
Message-ID: 20020227140841.Y7484-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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;

In response to

  • optimizer at 2002-02-27 21:01:19 from Zhang, Anna

Browse pgsql-admin by date

  From Date Subject
Next Message Zhang, Anna 2002-02-27 22:40:00 Re: optimizer
Previous Message Arguile 2002-02-27 22:03:09 Re: transactions and cursors......