View Single Post

   
  #6 (permalink)  
Old 04-19-2008, 09:56 AM
Tom Lane
 
Posts: n/a
Default Re: weird query plan

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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply With Quote