From the course: Microsoft Azure Synapse for Developers

Unlock the full course today

Join today to access over 25,000 courses taught by industry experts.

Manage statistics

Manage statistics

- [Instructor] In this demo, we are going to talk about statistics. Statistics are what both serverless and dedicated SQL pools use to optimize their queries. We are going to talk about statistics for dedicated SQL pools later on. But for serverless pools, we are going to learn how we can create statistics on a column. By default, the engine will automatically create statistics, but not for CSV files, at least not yet, only for Apache Parquet files. So for our keys, we need to create them ourselves. The way we create statistics is by running the stored procedure create_openrowset_statistics. And as a parameter, it needs to take in the statement, which is the exact statement that is going to be executed against our data. This statement can be inside the view, which is fine. We don't have to specify the view here, but we need to specify the openrowset query. So we do sys.sp_create_openrowset_statistics, and then we…

Contents