j256 / ormlite-core

Core ORMLite functionality that provides a lite Java ORM in conjunction with ormlite-jdbc or ormlite-android
http://ormlite.com/
ISC License
577 stars 212 forks source link

Add support of SQLite INDEXED BY extension to a table declaration in the query or a generic extension #298

Closed ComBatVision closed 2 months ago

ComBatVision commented 2 months ago

Hi,

When I am doing complex selects using 5 and more tables on SQLite via ORMLite it often selects wrong inexes and makes queries dramatiacally slow.

Is it possible to add INDEXED BY and NOT INDEXED extension support to query builder or any generic prefix to be able to input following extension to a join statement: INNER JOIN 'SOME_TABLE' INDEXED BY 'SOME_INDEX_NAME'

From my perspective it can be something like setAlias() and looks like following: dao.queryBuilder().setIndexedBy("SOME_INDEX_NAME")

More info here: https://www.sqlite.org/lang_indexedby.html

ComBatVision commented 2 months ago

I have read SQLite documentation and they do not recommend to use this statement, so I will play with indexes.