1

I am trying to optimize the database by creating missing indexes, but the dm_db_missing_index_details table does not have any data.

I have the same database on different server and there are many records in that table. So it looks there may be a configuration problem causing the missing index requests to not be saved.

Why are there missing index requests on one server, but there aren't any on the other server (for the same database)?

We have not restarted the database server for the last four days. I am sure there should be index issues, because the same db is running at a different location and that one has many missing index warnings (and we fixed those).

Paul White
95.3k30 gold badges439 silver badges689 bronze badges
asked Jun 14, 2016 at 16:06
0

2 Answers 2

1

Depending on which version of SQL Server you're on, missing index (and other index metadata) may disappear when you rebuild indexes.

See Kendra Little's post for more information.

answered Apr 11, 2018 at 14:14
1

Check that no one has enabled trace flag 2392, as documented in:

FIX: Access violation when you cancel a pending query if the missing indexes feature is enabled in SQL Server

The workaround for this issue is to enable the Trace Flag (TF) 2392 which will suppress the collection of missing indexes.

It is not documented for SQL Server 2012, but that doesn't mean it wasn't subsequently back-ported, or functional but undocumented. Worth checking anyway.

More generally:

Unless you're running the same workload on both systems, the absence of missing index suggestions might be expected and normal.

SQL Server doesn't preemptively look for missing indexes, you have to run actual queries that could have used those indexes. Also, differences in data, statistics, hardware, and other things can make it so that the same queries don't generate the same plans on both systems, and hence different indexes are useful (or not).

Index creation should be scripted and version controlled (just like the source code in your app). If you have the same database installed in multiple locations, they should all be running the same codebase, which includes the same tables and index structures.

See also:

answered Jan 25, 2019 at 17:39

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.