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

usql.stats_columns (U-SQL)

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

Contains a row for each column that is part of usql.stats statistics.

Column nameData typeDescription
object_id_guidGuidIdentifier of the object on which the statistics is defined
stats_id_guidGuidIdentifier of the statistics of which the column is part
stats_column_idintOrdinal position (starting at 1) of the column within the list of statistics columns
column_idintPosition of the column within the object on which the statistics is specified (unique within object_id_guid)

Examples

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

Query the usql.stats_columns view

USE TestReferenceDB;

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

Query the usql.stats_columns view with other catalog views

@stats_columns =
    SELECT o.name AS objectName,
            s.name AS statName,
            c.name AS columnName,
            sc.*
    FROM usql.objects AS o
    JOIN usql.stats AS s
    ON o.object_id_guid == s.object_id_guid
    JOIN usql.stats_columns AS sc
    ON s.object_id_guid == sc.object_id_guid
    JOIN usql.columns AS c
    ON sc.object_id_guid == c.object_id_guid
    AND sc.column_id == c.column_id;

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

See Also

© 2018 Microsoft