From the course: Advanced SQL for Query Tuning and Performance Optimization
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Collect statistics about data in tables - SQL Tutorial
From the course: Advanced SQL for Query Tuning and Performance Optimization
Collect statistics about data in tables
- [Instructor] Schemas hold the data structures we commonly think of when we think of databases, and these are things like tables, indexes, constraints, views and materialized views, but they also include statistics about the data in those tables. For example, we need statistics on the number of rows in a table and how much storage is used. We also need to know the frequency of values and the cardinality of columns. It's also important to understand the distribution of data or how is that data kind of spread out. Under a normal distribution, data values tend toward the middle or the mean of the range and fall equally off in both directions. But sometimes values can tend toward one end of the distribution more than the other. So here, for example, we have a distribution where there are more instances toward the larger values. We call this a negative skew, and here we have values tending toward the lower end of the range.…
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Collect statistics about data in tables3m 21s
-
(Locked)
Analyzing execution statistics with pg_stat_statements1m 54s
-
(Locked)
Reviewing execution plans with the auto_explain module2m 34s
-
(Locked)
Additional analysis with other pg_stats data1m 26s
-
(Locked)
Challenge: Analyze schema statistics23s
-
(Locked)
Solution: Analyze schema statistics16s
-
(Locked)
-
-