Re: "Broken" Plan? Nested Loop IN Join vs. Nested Loop/Hash Aggregate - Mailing list pgsql-general

From Tom Lane
Subject Re: "Broken" Plan? Nested Loop IN Join vs. Nested Loop/Hash Aggregate
Date
Msg-id 26989.1163014973@sss.pgh.pa.us
Whole thread Raw
In response to "Broken" Plan? Nested Loop IN Join vs. Nested Loop/Hash Aggregate  ("Worky Workerson" <worky.workerson@gmail.com>)
List pgsql-general
"Worky Workerson" <worky.workerson@gmail.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: killing autovac
Next
From: "Dann Corbit"
Date:
Subject: Re: Stable sort?