Re: different query plan because different limit # (Re: weird query plan)

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "weiping" <laserlist(at)pgsqldb(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: different query plan because different limit # (Re: weird query plan)
Date: 2007-06-06 09:21:59
Message-ID: 87ejkph1zc.fsf@oxford.xeocode.com
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
> (cost=0.00..6750.55 rows=1094 width=4) (actual time=1.478..16.563 rows=41 loops=1)
> Index Cond: (userid = 219177)
> Filter: ("share" = 1)

It's estimating 1094 rows and getting 41 rows. You might considering raising
the statistics target for that table.

Does it get accurate estimates for the number of rows for each of these?

explain analyze select * from wd_urlusermaps where userid=219177
explain analyze select * from wd_urlusermaps where share=1

(the latter might take a while)

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Douglas J Hunley 2007-06-06 14:35:19 Re: upgraded to pgsql 8.2.4, getting worse performance then 7.4.x
Previous Message weiping 2007-06-06 07:40:57 Re: different query plan because different limit # (Re: weird query plan)