usql.stats (U-SQL)
Summary
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 name | Data type | Description |
---|---|---|
object_id_guid | Guid | Identifier of the object on which the statistics is defined |
name | string | Name of the statistics, unique for the object on which the statistics is defined |
stats_id_guid | Guid | Identifier of the statistics (unique within the object) |
create_date | DateTime? | 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_date | DateTime? | 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_byte | byte[] | 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);