MySQL Forums
Forum List  »  Performance

how to force index usage with a small local dev database
Posted by: Raf Mahn
Date: February 16, 2018 03:21AM

Is it possible to force mysql to use indexes for a small amount of data in the db? It is just for local development testing purposes. Can I change any parameter in mysql to force index usage?

I have created a java junit testing library that wraps all queries sent to the DB and verifies that all queries are using an index, if not then we can specify that that query doesn't use an index. But I do notice that the explain plan changes depending on the data in the table. So my tests randomly fail depending on mysql behaviour.

It is nice to get automated feedback from tests before the sql hits production. But given it randomly fails it may be more hassel than it is worth.

Options: ReplyQuote

Written By
how to force index usage with a small local dev database
February 16, 2018 03:21AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.