Re: "Broken" Plan? Nested Loop IN Join vs. Nested Loop/Hash Aggregate

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Worky Workerson" <worky(dot)workerson(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: "Broken" Plan? Nested Loop IN Join vs. Nested Loop/Hash Aggregate
Date: 2006-11-08 19:42:53
Message-ID: 26989.1163014973@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Worky Workerson" <worky(dot)workerson(at)gmail(dot)com> writes:
> -> Index Scan using ip_profiles_pkey on ip_profiles
> (cost=0.00..3.37 rows=1 width=4) (actual time=0.035..1195.567
> rows=144445 loops=1)
> Index Cond: ((ip > '1.0.0.0'::ip4) AND (ip <= '1.255.255.255))

Um ... have you ANALYZEd these tables recently? If so, try increasing
the statistics target for them. You aren't ever going to get decent
plans when the rowcount estimates are off by five orders of magnitude,
and for such a simple condition I see no reason why they would be
except for obsolete or inadequate stats.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2006-11-08 19:53:37 Re: Stable sort?
Previous Message Tom Lane 2006-11-08 19:39:02 Re: killing autovac