ormlite-jdbc icon indicating copy to clipboard operation
ormlite-jdbc copied to clipboard

Support for SQL query index hints.

Open pezi opened this issue 2 years ago • 1 comments

For my project there is a master table which describes the main entity of the project - million of entitys.

There are many different querys on this tabe to get very specifc user view. To improve the performance, different sets of SQL indices were created. But it necessary to use index hints (https://dev.mysql.com/doc/refman/8.0/en/index-hints.html) to persuade the database to use the right index. As a a work arround we use raw query statments from this project which where extentend with this hints. But loading the Java object from this query generates a extra work load.

Alternativ - extend the query API to get and manipulate the interal final query string, which will used on the DB, on your own risk to catch such specific needs.

pezi avatar Feb 02 '23 08:02 pezi

Ok I see what you are asking now. You are looking for adding USE INDEX ... as part of the query. This is supported by MySQL and I see support for this in other database types as well.

j256 avatar Feb 14 '23 23:02 j256