Re: BUG #7591: Large query string has limit - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #7591: Large query string has limit
Date
Msg-id 2282.1349807667@sss.pgh.pa.us
Whole thread Raw
In response to BUG #7591: Large query string has limit  (pking@nrcan.gc.ca)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #7589: Canceled "CREATE UNIQUE INDEX CONCURRENTLY" leave not-fully-build index existing
Next
From: Tom Lane
Date:
Subject: Re: BUG #7590: Data corruption using pg_dump only with -Z parameter