usql.indexes (U-SQL)

 

Updated: September 26, 2017

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

System_CAPS_ICON_note.jpg Note

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:

CLUSTERED

NONCLUSTERED

CLUSTERED COLUMNSTORE

Examples

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 o.name AS objectName,
            i.*
    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

Community Additions

ADD
Show: