create index ix_test on ships(name) with statistics_only
go
set showplan_all on
go
set noexec on
go
select *
from ships with (index = ix_test)
go
set showplan_all off
go
set noexec off
go
В итоге — Index 'ix_test' on table 'ships' (specified in the FROM clause) does not exist.
Была такая мысль, но автор, добавляя в «режим автопилота» кластерный индекс (index id = 1), использует такую строку:
DBCC AUTOPILOT (6, 9, 37575172, 1, 0, 0, 0) — Clustered Index with TypeID 6
Хотя тип 6 в sys.indexes никак не может соответствовать кластерному индексу.
А гипотетический индекс (index id = 5) он добавляет строкой:
DBCC AUTOPILOT (0, 9, 37575172, 5, 0, 0, 0) — All other index with TypeID 0
хотя 0 должно быть кучей.
Недокументированные возможности Microsoft SQL Server: STATISTICS_ONLY, DBCC AUTOPILOT и SET AUTOPILOT