HI,

When you do a WMS GetFeatureInfo in geoserver, the query it builds is a bit
sub-optimal:

SELECT OSM_ID,NAME,TYPE,GEOM as GEOM FROM WWW_DATA.BAHNEN_21781 WHERE
(SDO_FILTER(GEOM, ?, '
mask=anyinteract querytype=WINDOW') = 'TRUE' OR SDO_FILTER(GEOM, ?,
'mask=anyinteract querytype=WINDOW') =
'TRUE' )

Yes, the bbox is set twice. That wouldn't be a problem if there wasn't a
bug in Oracle where the index is not used anymore if you do that.

I wrote a little POC in Java to confirm the Oracle problem. Here is the
output:
Connecting...
Connected

Running query SELECT OSM_ID,NAME,TYPE,GEOM as GEOM FROM
WWW_DATA.BAHNEN_21781 WHERE SDO_FILTER(GEOM, ?, 'm
ask=anyinteract querytype=WINDOW') = 'TRUE'
   OSM_ID=315756167
   OSM_ID=23407704
runtime=6ms

Running query SELECT OSM_ID,NAME,TYPE,GEOM as GEOM FROM
WWW_DATA.BAHNEN_21781 WHERE (SDO_FILTER(GEOM, ?, '
mask=anyinteract querytype=WINDOW') = 'TRUE' OR SDO_FILTER(GEOM, ?,
'mask=anyinteract querytype=WINDOW') =
'TRUE' )
   OSM_ID=23407704
   OSM_ID=315756167
runtime=104411ms

I checked the query plan in Oracle and it does a full table scan for the
second case... that expains the 104s runtime.

Now, fixing Oracle is, let say, a Gargatuan task, so I had a look to fix
geotools.

After a fun debugging session, I've come up with this patch:
https://github.com/pvalsecc/geotools/commit/2940c942e226a65b929cd757ce5a5784423d684b

Since I'm new to this lib, can somebody tell me what I should do next?

Thanks.
------------------------------------------------------------------------------
_______________________________________________
GeoTools-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to