question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion MySQL Index Hints

See original GitHub issue

Has anyone thought about the ability to add index hints in queries for MySQL. I thought an option like useIndex could passed into the find functions.

Something like the following

var options = {
    useIndex: "my_fast_index"
};
mymodel.findAll(options);

I can look at submitting a PR if this interests anyone else.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jessethomsoncommented, Apr 12, 2018

Did this ever happen? This functionality would be amazing.

0reactions
monukanyalcommented, Oct 5, 2018

Is this feature added now?

Read more comments on GitHub >

github_iconTop Results From Across the Web

MySQL 8.0 Reference Manual :: 8.9.4 Index Hints
Index hints give the optimizer information about how to choose indexes during query processing. Index hints, described here, differ from optimizer hints, ...
Read more >
Essential Guide To MySQL USE INDEX Hint By Examples
This tutorial shows you how to use the MySQL USE INDEX hint instruct the query optimizer to use only a list of named...
Read more >
Choosing the best indexes for MySQL query optimization
Choosing the correct index to optimize an SQL query can be a rather complex task, especially when trying to optimize a complex query...
Read more >
Is it a good practice to use index hints in production code?
The main reason why you should avoid it is because it requires explicitly naming an index in your hint, and if the index...
Read more >
Index Hints: How to Force Query Plans - MariaDB
Forcing Usage of a Specific Index for the WHERE Clause · USE INDEX: Use a Limited Set of Indexes · IGNORE INDEX: Don't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found