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?
asked Sep 12, 2018 at 17:23
2
  • 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. Commented Sep 12, 2018 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. Commented Oct 5, 2018 at 5:07

1 Answer 1

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

answered Sep 12, 2018 at 17:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.