Re: Planning large IN lists - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Planning large IN lists
Date
Msg-id 23045.1179408878@sss.pgh.pa.us
Whole thread Raw
In response to Re: Planning large IN lists  ("Atul Deopujari" <atul.deopujari@enterprisedb.com>)
Responses Re: Planning large IN lists  ("Atul Deopujari" <atuld@enterprisedb.com>)
List pgsql-hackers
"Atul Deopujari" <atul.deopujari@enterprisedb.com> writes:
> Hi,
> Tom Lane wrote:
>> That's the least of the problems.  We really ought to convert such cases
>> into an IN (VALUES(...)) type of query, since often repeated indexscans
>> aren't the best implementation.
>> 
> I thought of giving this a shot and while I was working on it, it 
> occurred to me that we need to decide on a threshold value of the IN 
> list size above which such transformation should take place.

I see no good reason to suppose that there is/should be a constant
threshold --- most likely it depends on size of table, availability of
indexes, etc.  Having the planner try it both ways and compare costs
would be best.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BufFileWrite across MAX_PHYSICAL_FILESIZE boundary
Next
From: Greg Smith
Date:
Subject: Re: Not ready for 8.3