Skip to content

IndexOptimize not listing Index on SchemaBinded Views #968

@GiorgioCazzaniga

Description

@GiorgioCazzaniga

Indexes of Schemabinded views are not processed by the IndexOptimize SP

Microsoft SQL Server 2022 (RTM-CU21) (KB5065865) - 16.0.4215.2 (X64)

OLA Script:
2025-08-23 17:25:24

What command are you executing?
IndexOptimize

What output are you getting?
Indexes of Schemabinded views are skipped.

Doing some tests, i found the problem sit in the evaluation of "IsMemoryOptimized" field: for those indexes it were given NULL because it was readed from the Tables systable. Forcing it as 0 if NULL in the header of the query fixed the issues, but there should be a more elegant way tofix that.

In addition, this query is undoable in very big databases -> fixed creating temp tables for each sys table used by the query as suggested here to speed up the performance:

https://dba.stackexchange.com/questions/234520/sql-server-index-and-statistics-maintenance-performance-question

Here the creation script reviewed:

IndexOptimize SP GC 20251124.sql

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions