1

I've added a new index to account for some performance issues however the queries that I would expect to be using the new index are still are not using it. In SQL Server you can flush an execution plan a couple of different ways to correct a poor performing query and I'm looking to understand if that is also possible in MySQL.

  • Can a specific execution plan be removed?
  • Can a all of the stored execution plans be removed?
  • MySQL do not store execution plans. If server do not use new index, you may try to force its use by index hint(s)... but in most cases, the index, which you think is more appropriate, is not really that. – Akina Sep 12 '18 at 17:32
  • There may be a valid reason for not using the new index. Let's see the query and it's EXPLAIN, plus SHOW CREATE TABLE. – Rick James Oct 5 '18 at 5:07
0

Sadly, you cannot do that with MySQL.

Notwithstanding, there are two things try

1: Tweek the Query Optimizer

You can change the Query Optimizer behavior. Please see my posts about doing so, but always check the MySQL Documentation first and foremost.

2: Make MySQL use the index

Rather that reinvent the wheel, see my old post from Oct 28, 2011, Using FORCE INDEX

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.