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

usql.stats (U-SQL)

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

Contains a row for each statistics object that exists for the tables in the current database context.

The catalog view usql.stats_columns provides statistics information for each column in the database. For more information about statistics, see U-SQL Statistics.

Column nameData typeDescription
object_id_guidGuidIdentifier of the object on which the statistics is defined
namestringName of the statistics, unique for the object on which the statistics is defined
stats_id_guidGuidIdentifier of the statistics (unique within the object)
create_dateDateTime?Date of creation of the statistics. Some older statistics may have a value of null if they were created before the date was being recorded.
update_dateDateTime?Last update date of the statistics. Some older statistics may have a value of null if they were updated before the date was being recorded.
stat_data_bytebyte[]Content of the statistics. CAUTION: This column may be subject to change in a future refresh!

Examples

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

Query the usql.stats view

USE TestReferenceDB;

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

Query the usql.stats view with usql.objects view

@stats =
    SELECT o.name AS objectName,
            s.*
    FROM usql.stats AS s
    JOIN usql.objects AS o
    ON s.object_id_guid == o.object_id_guid;

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

See Also

© 2018 Microsoft