Re: Help with a seq scan on multi-million row table - Mailing list pgsql-sql

From Tom Lane
Subject Re: Help with a seq scan on multi-million row table
Date
Msg-id 26129.1147312429@sss.pgh.pa.us
Whole thread Raw
In response to Re: Help with a seq scan on multi-million row table  (<ogjunk-pgjedan@yahoo.com>)
Responses Re: Help with a seq scan on multi-million row table
ORDER BY question
List pgsql-sql
<ogjunk-pgjedan@yahoo.com> writes:
> Aha!  set hashjoin=off did the trick.

>                ->  Index Scan using ix_user_url_tag_user_url_id on user_url_tag userurltag0_  (cost=0.00..157.34
rows=103width=14) (actual time=1.223..1.281 rows=5 loops=1666)
 
>                      Index Cond: (userurltag0_.user_url_id = "outer".id)

This seems to be the problem right here: the estimate of matching rows
is off by a factor of 20, and that inflates the overall cost estimate
for this plan about the same, causing the planner to think the other way
is cheaper.

What does the pg_stats row for user_url_tag.user_url_id contain?
Have you analyzed that table recently?
        regards, tom lane


pgsql-sql by date:

Previous
From:
Date:
Subject: Re: Help with a seq scan on multi-million row table
Next
From:
Date:
Subject: Re: Help with a seq scan on multi-million row table