Hi,
Thanks for bringing this to my attention.
The OGC_STRICT mode was always going to be slower because of the
need for constructors. I suspect that the constructor around the GEOM
column also has the effect that the spatial index is not used.
The CASE statement in the non strict mode was used to have the
intersection generate the proper return values when used in the
SELECT part of a statement. I'll see how to modify the code so that
different SQL statements are generated when used in SELECT or in
WHERE parts.
Regards,
Karel Maesen
On 10 May 2008, at 18:53, jose garcia wrote:
> Hi
>
> I'm using Oracle Spatial provider to select the elements in a layer
> that intersects a buffer polygon, but querys are really slow to
> execute (layers have spatial indexes):
>
> Code is like:
>
> Criteria searchCriteria = session.createCriteria
> (Address.class);
> Geometry buffer = ...
> searchCriteria.add(SpatialRestrictions.intersects
> ("geometry", null, buffer));
> results = searchCriteria.list();
>
>
> 1) Using OGC_STRICT mode = TRUE the generated query is like:
>
> select * from MN_GC this_
> where MDSYS.OGC_INTERSECTS(MDSYS.ST_GEOMETRY.FROM_SDO_GEOM
> (this_.GEOM),
> MDSYS.ST_GEOMETRY.FROM_SDO_GEOM(?)) = 1 and
> this_.GEOM is not null
>
> And it's very slow to execute (about 2 minutes)
>
> (I think that MDSYS.ST_GEOMETRY.FROM_SDO_GEOM calls are slowing the
> query, but I don't know how can be resolved)
>
>
> 2) Using OGC_STRICT mode = FALSE the generated query is like:
>
> select *
> from MN_GC this_
> where CASE SDO_RELATE(this_.GEOM,?,'mask=ANYINTERACT') WHEN 'TRUE'
> THEN 1 ELSE 0 END = 1
> and this_.GEOM is not null
>
> And it's also very slow to execute, but simply changing the query
> and launching from sql/plus:
>
> select *
> from MN_GC this_
> where SDO_RELATE(this_.GEOM,?,'mask=ANYINTERACT') = 'TRUE'
> and this_.GEOM is not null
>
> the response it's inmediate, seems that CASE operator slows the query
>
> You should revise the code that generates the query to change it.
>
> Thank's in advance.
>
>
> _______________________________________________
> hibernatespatial-users mailing list
>
[hidden email]
>
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/
> hibernatespatial-users
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users