Re: [HACKERS] Hypothetical suggestions for planner, indexing improvement

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-performance <pgsql-performance(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Hypothetical suggestions for planner, indexing improvement
Date: 2003-05-06 13:07:47
Message-ID: 20030506080747.C66185@flake.decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On Mon, May 05, 2003 at 09:33:33PM -0700, Josh Berkus wrote:
> EXISTS is more flexible than IN; how can you do a 3-column corellation on an
> IN clause?

It would be nice to add support for multi-column IN..

WHERE (a, b, c) IN (SELECT a, b, c ...)

BTW, does postgresql handle IN and EXISTS differently? Theoretically if
the optimizer was good enough you could transform one to the other and
not worry about it. Whenever possible, I try and use IN when the
subselect will return a very small number of rows, since IN might be
faster than EXISTS in that case, though it seems most optimizers tend to
fall apart when they see ORs, and a lot of databases transform IN to a
OR b OR c.
--
Jim C. Nasby (aka Decibel!) jim(at)nasby(dot)net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2003-05-06 13:10:35 Re: [HACKERS] Hypothetical suggestions for planner, indexing improvement
Previous Message Karsten Hilbert 2003-05-06 12:23:56 Re: Installin Postgres

Browse pgsql-performance by date

  From Date Subject
Next Message Jim C. Nasby 2003-05-06 13:10:35 Re: [HACKERS] Hypothetical suggestions for planner, indexing improvement
Previous Message Richard Huxton 2003-05-06 13:04:24 Re: Select on timestamp-day slower than timestamp alone