Re: weird query plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: weiping <laserlist(at)pgsqldb(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: weird query plan
Date: 2007-06-06 14:40:41
Message-ID: 20759.1181140841@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

weiping <laserlist(at)pgsqldb(dot)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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Scott Marlowe 2007-06-06 15:07:19 Re: Thousands of tables versus on table?
Previous Message Douglas J Hunley 2007-06-06 14:35:19 Re: upgraded to pgsql 8.2.4, getting worse performance then 7.4.x