[Geoserver-devel] oracle datastore possible inefficient queries..

There are some subtle differences between the oracle relate() and the
OGC DE-9 relate() matrix.

I'd suggest that the oracle sql writer doesnt convert "intersects" into
a "NOT(disjoint(...))" query. Depending on how well oracle executes
that query, it could be slow.

To make it fast, I'd suggest doing a query like this (for column
the_geom INTERSECTS <literal geom>):

WHERE
    (bounding box of <literal geom> intersects/overlaps the_geom
    AND the_Geom INTERSECTS <literal geom>);

That way oracle can use the index for the first part of the clause, and
then "do the math" for the 2nd part.

"Intersects" is the simple spatial operation - it return true if the two
geometries interact in any way (ie. distance between them = 0).

If you do update the oracle sql writer, please make sure you write test
cases and they are doing the right thing. Its easy to screw up if
people are doing NOT, OR, and AND clauses mixed up with their spatial
primatives. The postgis sql writer had some issues with this.

I'd recommend pay extra attention to any query with a "disjoint" in it
because its a bit more difficult to "get" information from just the
bounding boxes. For example;

A disjoint B does NOT imply bbox(A) disjoint
bbox(B)
bbox(A) disjoint bbox(B) does NOT imply A disjoint B

Also, disjoint queries can be very expensive to run on a database - even
with an index.

dave

----------------------------------------------------------
This mail sent through IMP: https://webmail.limegroup.com/