Re: alternate idioms for large "IN (...)" lists

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: russm <russm(at)icorp(dot)com(dot)au>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: alternate idioms for large "IN (...)" lists
Date: 2002-06-03 23:38:31
Message-ID: 12990.1023147511@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

russm <russm(at)icorp(dot)com(dot)au> writes:
> Just out of curiosity, why does postgresql's IN perform so poorly?

Because no one's gotten around to improving it.

The current implementation is actually just fine for small numbers of
values in the IN-list. Making it work nicely for large numbers of
values without pessimizing the small-list case would involve supporting
(at least) two implementations and teaching the planner how to choose
one. This definitely should be done, but has not gotten to the top of
anyone's to-do queue.

Most of the complaints we've seen about IN performance have to do with
the IN-subselect case, which is yet a different animal. It's likely
that that will get fixed before anyone worries about the large-number-
of-scalar-values case...

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sandeep Chibber 2002-06-04 06:52:10 Postgres Function Problem
Previous Message Marie G. Tuite 2002-06-03 21:43:01 passing a list to a function and returning a recordset