Re: New hashed IN code ignores distinctiveness of subquery - Mailing list pgsql-bugs

From Tom Lane
Subject Re: New hashed IN code ignores distinctiveness of subquery
Date
Msg-id 19654.1043643608@sss.pgh.pa.us
Whole thread Raw
In response to Re: New hashed IN code ignores distinctiveness of subquery  (Bradley Baetz <bbaetz@acm.org>)
List pgsql-bugs
Bradley Baetz <bbaetz@acm.org> writes:
> By cached, do you mean PREPARE stuff, or something else?

PREPARE, and cached plans in plpgsql, and cached plans in SPI, and
cached plans for foreign keys (though probably those never use IN)
and perhaps other places I'm not thinking of at the moment.

> However, its much faster (although not as fast as sticking the DISTINCT
> in there myself), but the actual rows coming from the sort is really odd
> - where is that number coming from? How can sorting 9 rows take 44476
> anythings?

We're back full circle to my original comment about rescans in
mergejoin.  The EXPLAIN ANALYZE instrumentation counts a re-fetch
as another returned row.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bradley Baetz
Date:
Subject: Re: New hashed IN code ignores distinctiveness of subquery
Next
From: "Key88 SF"
Date:
Subject: Cursor case-sensitivity