Table of contents
Collapse the table of content
Expand the table of content

usql.indexes (U-SQL)

Michael Rys|Last Updated: 5/15/2018
4 Contributors

Contains one row per index for the schemas of the current database context.


Some of the values documented below, such as the values for non-clustered indices and column-store indices, are there for possible future use and are not currently used.

Column nameData typeDescription
namestringName of the index
object_id_guidGuidIdentifier of the object on which the index is defined
index_idintOrdinal position (starting at 1) of the index within the object/table
typeintType of index:

1 = Clustered

2 = Nonclustered

5 = Clustered Columnstore
type_descstringDescription of index type:





The examples can be executed in Visual Studio with the Azure Data Lake Tools plug-in.

Query the usql.indexes view

USE TestReferenceDB;

OUTPUT usql.indexes
TO "/ReferenceGuide/CatalogViews/indexes.txt"
USING Outputters.Tsv(outputHeader:true);

Query the usql.indexes view with usql.objects view

@indexes =
    SELECT AS objectName,
    FROM usql.indexes AS i
    JOIN usql.objects AS o
    ON i.object_id_guid == o.object_id_guid;

OUTPUT @indexes
TO "/ReferenceGuide/CatalogViews/indexes_objects.txt"
USING Outputters.Tsv(outputHeader:true);  

See Also

© 2018 Microsoft