pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rajesh Kumar Mallah <mallah@trade-india.com>
To: Stephan Szabo <sszabo@megazone23.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: planner question..
Date: Thu, 17 Apr 2003 19:27:08 +0530
Message-ID: <200304171927.08124.mallah@trade-india.com> (raw)
In-Reply-To: <20030417064926.C87131-100000@megazone23.bigpanda.com>
References: <20030417064926.C87131-100000@megazone23.bigpanda.com>


Thanks Stephan,

I think there shud be more documentation on
understanding EXPLAIN (ANALYZE) output.
once i found an webpage but lost it.

where do u see its expecting 5000 not 100000?

Regds
mallah.

On Thursday 17 Apr 2003 7:21 pm, Stephan Szabo wrote:
> On Thu, 17 Apr 2003, Rajesh Kumar Mallah wrote:
> > For a distribution of data like below why does the planner
> > choses to do an index scan by default for source = 'REGIS' when > 50%
> > of the rows are having source='REGIS'.
>
> It's not estimating that though.
>
> > tradein_clients=# SET enable_indexscan=off;
> > tradein_clients=# explain analyze SELECT count(*) from  profile_master
> > where source='REGIS';
> > +------------------------------------------------------------------------
> >------------------------------------------------------+
> >
> > |                                                          QUERY PLAN    
> > |                                                      |
> >
> > +------------------------------------------------------------------------
> >------------------------------------------------------+
> >
> > | Aggregate  (cost=23982.58..23982.58 rows=1 width=0) (actual
> > | time=22872.97..22872.97 rows=1 loops=1)                          | -> 
> > | Seq Scan on profile_master  (cost=0.00..23970.40 rows=4871 width=0)
> > | (actual time=328.44..22730.69 rows=102090 loops=1) |
>
> It's expecting that about 5000 rows match not 100000.
>
> Does it get better if you raise the statistics target for the
> column (see ALTER TABLE) from 10 to say 50 or 100?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.




view thread (8+ messages)  latest in thread

Message-ID: <200304171927.08124.mallah@trade-india.com>
Permalink:  ../200304171927.08124.mallah@trade-india.com/
Also on:    postgresql.org/message-id/200304171927.08124.mallah@trade-india.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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mallah@trade-india.com, sszabo@megazone23.bigpanda.com
  Subject: Re: planner question..
  In-Reply-To: <200304171927.08124.mallah@trade-india.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