pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: James Robinson <jlrobins@socialserve.com>
Cc: pgsql-jdbc@postgresql.org
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Prepared Statements and large where-id-in constant blocks?
Date: Mon, 19 Apr 2004 21:02:38 -0400
Message-ID: <2046.1082422958@sss.pgh.pa.us> (raw)
In-Reply-To: <11531DB4-921A-11D8-8696-000A9566A412@socialserve.com>
References: <11531DB4-921A-11D8-8696-000A9566A412@socialserve.com>

James Robinson <jlrobins@socialserve.com> writes:
> where there may be anywhere between 1 and thousands of "(id = N)" 
> blocks ORed together. These may be transformed to the "WHERE t1.id IN 
> (X, Y, ...)" form for possibly a little performance gain (possibly -- 
> I've not yet checked to see if this plans better than the other, but I 
> could imagine this form being parsed into the hashjoin form as opposed 
> to a huge index filter form).

There is *no difference whatever*; in fact the PG parser expands an IN
clause into an OR'd list.

Possibly this is something to improve someday, but there's surely no
percentage in doing lots of work in the JDBC driver to prefer the IN
form at the moment.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <2046.1082422958@sss.pgh.pa.us>
Permalink:  ../2046.1082422958@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2046.1082422958@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jlrobins@socialserve.com, pgsql-jdbc@postgresql.org
  Subject: Re: [SQL] Prepared Statements and large where-id-in constant blocks?
  In-Reply-To: <2046.1082422958@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox