Hi all,

Recently, a group of GeoServer users on HANA requested the possibility to 
append hints to SQL queries. Luckily, there was already 
SQLDialect#handleSelectHints(). So, I could just override the method in 
HanaDialect and append the hints to the query, which I did in [GEOT-7230] 
(https://github.com/geotools/geotools/pull/4064).

Now the group of users who requested the feature noticed that it works for 
common GeoServer layers, but not for GeoServer views, which are based on 
GeoTools' VirtualTable. I investigated and found that JDBCDataStore 
deliberately blocks the addition of search hints 
(https://github.com/geotools/geotools/blob/29394a11ce3128a625f5251abeb9b0b09cc0105b/modules/library/jdbc/src/main/java/org/geotools/jdbc/JDBCDataStore.java#L3505).

I found that the SQLDialect#handleSelectHints() has been introduced with 
"[GEOT-4707] Add a flag to force spatial index usage in sql server" 
(https://github.com/geotools/geotools/pull/371/files). Adding search hints to 
VirtualTable queries was blocked from the start.

Does someone know why search hints are not added to VirtualTable queries?

In the HANA use case, I could not identify any reason yet why the addition of 
search hints should be blocked. I might oversee something though. If there is 
no urgent reason to block search hints in VirtualTable queries, what would be a 
good way to support search hints on VirtualTable queries in a SQLDialect? Would 
the introduction of an additional function like 
appendSearchHintsToVirtualTableQueries() be acceptable?

Thank you and best regards,
Stefan


_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to