How to append Oracle specific hints to queries

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to append Oracle specific hints to queries

pmgmendes
Hi,

I've been analyzing the gt-jdbc-oracle library in order to identify where one could add some Oracle specific hints to queries made against a Orace database. From what I can perceive, in the execution of a normal getMap operation, the SELECT statement is built in the gt-jdbc classes (using the "org.geotools.data.jdbc.DefaultSQLBuilder.buildSQLQuery" method, for instance) and the gt-jdbc-oracle is responsible for append the Oracle locator/spatial specific functions to the WHERE clause, right?

How can something like this can be achieved with a minimum impact in the code base?

Thanks!

Pedro Mendes

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GeoTools-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to append Oracle specific hints to queries

geowolf
On Wed, Jan 25, 2012 at 1:07 PM, Pedro Mendes <[hidden email]> wrote:
Hi,

I've been analyzing the gt-jdbc-oracle library in order to identify where one could add some Oracle specific hints to queries made against a Orace database. From what I can perceive, in the execution of a normal getMap operation, the SELECT statement is built in the gt-jdbc classes (using the "org.geotools.data.jdbc.DefaultSQLBuilder.buildSQLQuery" method, for instance) and the gt-jdbc-oracle is responsible for append the Oracle locator/spatial specific functions to the WHERE clause, right?

Correct. We keep most of the code in classes shared among all databases to make it possible to maintain it all
(we had one datastore per dbms in the past, the only one that was always up to date was the postgis one).
 

How can something like this can be achieved with a minimum impact in the code base?

I guess it could be done by giving the SQLDialect a say on what gets in the SELECT clause,
and then.. probably use query hints to pass down the oracle hint

Cheers
Andrea


--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 962313
mob:    +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GeoTools-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to append Oracle specific hints to queries

pmgmendes
Thanks for the feedback.

Mendes.

On Wed, Jan 25, 2012 at 1:10 PM, Andrea Aime <[hidden email]> wrote:
On Wed, Jan 25, 2012 at 1:07 PM, Pedro Mendes <[hidden email]> wrote:
Hi,

I've been analyzing the gt-jdbc-oracle library in order to identify where one could add some Oracle specific hints to queries made against a Orace database. From what I can perceive, in the execution of a normal getMap operation, the SELECT statement is built in the gt-jdbc classes (using the "org.geotools.data.jdbc.DefaultSQLBuilder.buildSQLQuery" method, for instance) and the gt-jdbc-oracle is responsible for append the Oracle locator/spatial specific functions to the WHERE clause, right?

Correct. We keep most of the code in classes shared among all databases to make it possible to maintain it all
(we had one datastore per dbms in the past, the only one that was always up to date was the postgis one).
 

How can something like this can be achieved with a minimum impact in the code base?

I guess it could be done by giving the SQLDialect a say on what gets in the SELECT clause,
and then.. probably use query hints to pass down the oracle hint

Cheers
Andrea


--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054  Massarosa (LU)
Italy

phone: <a href="tel:%2B39%200584%20962313" value="+390584962313" target="_blank">+39 0584 962313
fax:      <a href="tel:%2B39%200584%20962313" value="+390584962313" target="_blank">+39 0584 962313
mob:    <a href="tel:%2B39%C2%A0339%208844549" value="+393398844549" target="_blank">+39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GeoTools-Devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-devel