Missing Index DMVs have a limited capacity. How can I work around that?

The system dynamic-management-views for tracking index suggestions are limited to displaying 500 indexes at most. In a busy system with either a lot of databases or a lot of tables, this can be substantially limiting.

The system DMVs are:

One potential workaround for this issue is to temporarily create an index for the tables listed in sys.dm_db_missing_index_details DMV, then immediately drop those indexes. Optimally, the index would have a filter that limits the number of rows “covered” by the index to 0, since this will make running CREATE INDEX as fast as possible. I was inspired to write this post by the excellent work done by Joe Sack, and the comments made by Glenn Berry on this post on SQLSkills.com.

I’ve just created a stored procedure to handle this situation:

For example: