What “Clustered Index Scan (Clustered)” means on SQL Server execution plan?

前端 未结 5 1977
我在风中等你
我在风中等你 2021-02-02 07:52

I have a query that fails to execute with \"Could not allocate a new page for database \'TEMPDB\' because of insufficient disk space in filegroup \'DEFAULT\'\".

On the

5条回答
  •  一整个雨季
    2021-02-02 08:39

    Expanding on Gordon's answer in the comments, a clustered index scan is scanning one of the tables indexes to find the values you are doing a where clause filter, or for a join to the next table in your query plan.

    Tables can have multiple indexes (one clustered and many non-clustered) and SQL Server will search the appropriate one based upon the filter or join being executed.

    Clustered Indexes are explained pretty well on MSDN. The key difference between clustered and non-clustered is that the clustered index defines how rows are stored on disk.

    If your clustered index is very expensive to search due to the number of records, you may want to add a non-clustered index on the table for fields that you search for often, such as date fields used for filtering ranges of records.

提交回复
热议问题