From: Tom Lane <tgl@sss.pgh.pa.us>
To: pking@nrcan.gc.ca
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7591: Large query string has limit
Date: Tue, 09 Oct 2012 14:34:27 -0400
Message-ID: <2282.1349807667@sss.pgh.pa.us> (raw)
In-Reply-To: <E1TLbfT-00063H-Si@wrigleys.postgresql.org>
References: <E1TLbfT-00063H-Si@wrigleys.postgresql.org>
pking@nrcan.gc.ca writes:
> I am dealing with the open source program called "Geonetwork". It is passing
> the following query to postgres/postgis :
> SELECT "fid", asText("the_geom") FROM "public"."spatialindex" WHERE ("fid" =
> '10') OR ("fid" = '100') OR ("fid" = '1000') OR ("fid" = '10001') OR ("fid"
> = '10005') ..........
> Unfortunately, the query has > 50,000 OR clauses, and the query hangs.
[ rolls eyes ... ] You will not find a lot of DBMSes that don't have
indigestion with that. It's possible that converting to an IN list
would be less inefficient, but personally I'd suggesting putting all the
target IDs into a temp table and joining to that.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pking@nrcan.gc.ca
Subject: Re: BUG #7591: Large query string has limit
In-Reply-To: <2282.1349807667@sss.pgh.pa.us>
References: <E1TLbfT-00063H-Si@wrigleys.postgresql.org> <2282.1349807667@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