Question

Does anybody know what hypothetical indexes are used for in sql server 2000? I have a table with 15+ such indexes, but have no idea what they were created for. Can they slow down deletes/inserts?

Was it helpful?

Solution

hypothetical indexes are usually created when you run index tuning wizard, and are suggestions, under normal circumstances they will be removed if the wizard runs OK.

If some are left around they can cause some issues, see this link for ways to remove them.

OTHER TIPS

Not sure about 2000, but in 2005 hypothetical indexes and database objects in general are objects created by DTA (Database Tuning Advisor)

You can check if an index is hypothetical by running this query:

SELECT  *
FROM    sys.indexes
WHERE   is_hypothetical = 1

If you have given the tuning advisor good information on which to base it's indexing strategy, then I would say to generally trust its results, but if you should of course examine how it has allocated these before you trust it blindly. Every situation will be different.

A google search for "sql server hypothetical indexes" returned the following article as the first result. Quote:

Hypothetical indexes and database objects in general are simply objects created by DTA (Database Tuning Advisor)

Hypothetical indexes are those generated by the Database Tuning Advisor. Generally speaking, having too many indexes is not a great idea and you should examine your query plans to prune those which are not being used.

From sys.indexes:

is_hypothetical     bit     

1 = Index is hypothetical and cannot be used directly as a data access path. 
    Hypothetical indexes hold column-level statistics.

0 = Index is not hypothetical.

They could be also created manually with undocumented WITH STATISTICS_ONLY:

CREATE TABLE tab(id INT PRIMARY KEY, i INT);

CREATE INDEX MyHypIndex ON tab(i) WITH STATISTICS_ONLY = 0;
/* 0 - withoud statistics -1 - generate statistics */

SELECT name, is_hypothetical
FROM sys.indexes
WHERE object_id = OBJECT_ID('tab');

db<>fiddle demo

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top