pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: weiping <laserlist@pgsqldb.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: weird query plan
Date: Wed, 06 Jun 2007 10:40:41 -0400
Message-ID: <20759.1181140841@sss.pgh.pa.us> (raw)
In-Reply-To: <46662DE7.4030602@pgsqldb.com>
References: <46662DE7.4030602@pgsqldb.com>

weiping <laserlist@pgsqldb.com> writes:
> -> Index Scan using urlusermaps_userid on wd_urlusermaps a
> (cost=0.00..6750.55 rows=1094 width=96) (actual time=0.544..5.616
> rows=41 loops=1)
> Index Cond: (userid = 219177)
> Filter: ("share" = 1)

> the userid=219177 got 2000+ record and around 40 shared=1, why above 2 query
> shows so much difference?

Probably because the rowcount estimate is so far off (1094 vs 41).

Possibly boosting the statistics target would help.

			regards, tom lane



view thread (3+ messages)

Message-ID: <20759.1181140841@sss.pgh.pa.us>
Permalink:  ../20759.1181140841@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20759.1181140841@sss.pgh.pa.us

 · 

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, laserlist@pgsqldb.com
  Subject: Re: weird query plan
  In-Reply-To: <20759.1181140841@sss.pgh.pa.us>

* 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