Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 24CFA634001 for ; Thu, 9 Jul 2009 15:20:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 03762-03 for ; Thu, 9 Jul 2009 15:20:37 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail1.mailhostingservice.com (mail1.mailhostingservice.com [216.154.198.171]) by mail.postgresql.org (Postfix) with SMTP id B27C0633D41 for ; Thu, 9 Jul 2009 15:20:34 -0300 (ADT) Received: From aers.ca (24.68.32.77) by mail1.mailhostingservice.com Id ; Thr, 9 Jul 2009 18:19:25 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: Re: FW: Query length limitation in postgres server > 8.2.9 Date: Thu, 9 Jul 2009 11:20:27 -0700 Message-ID: <6B5AF6293A289F45826220B17ABE7937FDB1CC@BORON.aers.local> In-Reply-To: <366642367C5B354197A1E0D27BC175BD02259883@KGHMAIL.KGH.ON.CA> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] FW: Query length limitation in postgres server > 8.2.9 Thread-Index: Acn/Toj3+uQvGLS7R4iTLUaooYhk/wAA2rGAAFrpBBAAAC4Z0AAA49pw References: <6B5AF6293A289F45826220B17ABE7937FDB16C@BORON.aers.local> <6B5AF6293A289F45826220B17ABE7937FDB1C0@BORON.aers.local> <366642367C5B354197A1E0D27BC175BD02259883@KGHMAIL.KGH.ON.CA> From: To: , X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL=0.000, UNPARSEABLE_RELAY=0.001 X-Spam-Level: X-Archive-Number: 200907/46 X-Sequence-Number: 32787 Being just the server admin I'll forward this thought on to the dev's for consideration. -----Original Message----- From: Hartman, Matthew [mailto:Matthew.Hartman@krcc.on.ca]=20 Sent: Thursday, July 09, 2009 10:58 AM To: Jacob Bresciani; pgsql-sql@postgresql.org Subject: RE: [SQL] FW: Query length limitation in postgres server > 8.2.9 > From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql- > owner@postgresql.org] On Behalf Of jacob@aers.ca > Sent: Thursday, July 09, 2009 1:53 PM >=20 > I've simplified the query to make it easier to look at. >=20 > This one doesn't use the index's and therefore takes about 11713ms to > return. Have you considered joining two tables, one of which is a UNION ALL sum of the identifiers? For example: Select * From MyTable Inner join ( Select 12345 as MyColumn Union all select 45678 Union all select 7890 ) as MyCriteria on MyTable.MyColumn =3D MyCriteria.MyColumn; Matthew Hartman Programmer/Analyst Information Management, ICP Kingston General Hospital