Re: Regression in IN( field, field, field ) performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>
Cc: Decibel! <decibel(at)decibel(dot)org>, "Gregory Stark" <stark(at)enterprisedb(dot)com>, "Postgres Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Regression in IN( field, field, field ) performance
Date: 2008-10-26 01:55:47
Message-ID: 1218.1224986147@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Robert Haas" <robertmhaas(at)gmail(dot)com> writes:
> Given that, would it make any sense to put all the
> constants in an ARRAY and use OR for any variables? i.e. given

> Whatever IN (Const1, Var1, Const2, Var2, Const3, Var3)

> Generate:

> Whatever = ANY (ARRAY[Const1, Const2, Const3]) OR Whatever = Var1 OR
> Whatever = Var2 OR Whatever = Var3

Yeah, I like this --- it seems a bit more principled/easier to
understand than just arbitrarily switching between an all-ARRAY
and a no-ARRAY formulation, which is what I put in earlier today.
I'll go change that ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Fuhr 2008-10-26 02:31:31 Re: Full socket send buffer prevents cancel, timeout
Previous Message Guillaume Lelarge 2008-10-25 21:50:47 Patch for ALTER DATABASE WITH TABLESPACE