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