Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

how to use force index when construct session #1456

Open
imqishi opened this issue Oct 10, 2019 · 2 comments
Open

how to use force index when construct session #1456

imqishi opened this issue Oct 10, 2019 · 2 comments

Comments

@imqishi
Copy link

imqishi commented Oct 10, 2019

I want use session construct a query which has force index(specify_index)
is there a way to do this? if Session.statement is accessable, I can directly set session.Statement.JoinStr

@lunny
Copy link
Member

lunny commented Oct 11, 2019

Could you give an example of the SQL or table structure?

@imqishi
Copy link
Author

imqishi commented Oct 11, 2019

sorry for some confidential reason I cannot give table structure, but the SQL like this:

select * from myTable force index(specific_index) where a = 1 and b = 2 and c in (3,4,5)

if table is too large, mysql may not use correct index so sometimes force index is necessary

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants