You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: advocacy_docs/pg_extensions/query_advisor/index.mdx
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -34,13 +34,13 @@ See [Using EDB Query Advisor](using/#query_advisor_index_recommendationsmin_filt
34
34
35
35
## Statistics Advisor
36
36
37
-
Statistics play a crucial role in determining the quality of query execution plans chosen by the database query optimizer. Sometimes there are dependencies between columns, and unless we create combined statistics using extended statistics, the optimizer assumes these columns are independent. This assumption often leads to incorrect cardinality estimates, which in turn, results in a poor execution plan, negatively impacting query performance.
37
+
Statistics play a crucial role in determining the quality of query execution plans chosen by the database query optimizer. Sometimes there are dependencies between columns, and unless combined statistics are created using extended statistics, the optimizer assumes these columns are independent. This assumption often leads to incorrect cardinality estimates, which in turn, results in a poor execution plan, negatively impacting query performance.
38
38
39
-
To address this, we monitor queries where multiple-column filters are applied and check for any selectivity estimation errors. If such errors are detected, we treat those multi-column filters as potential candidates for extended statistics.
39
+
To address this, Statistics Advisor monitors queries where multiple-column filters are applied and checks for any selectivity estimation errors. If such errors are detected,those multi-column filters are treated as potential candidates for extended statistics.
40
40
41
-
Whenever extended statistics recommendations are generated, we process these candidates by exploring various combinations of columns, especially when more than two columns are involved in the filters. Since estimation errors alone don’t definitively indicate which columns are dependent, we try all possible combinations. Currently, to limit the candidate pool, we focus on statistics for no more than two columns at a time.
41
+
Whenever extended statistics recommendations are generated, Statistics Advisor processes those candidates by exploring various combinations of columns, especially when more than two columns are involved in the filters. Since estimation errors alone don’t definitively indicate which columns are dependent, Statistic Advisor tries all possible combinations. Currently, to limit the candidate pool, the focus on statistics is for no more than two columns at a time.
42
42
43
-
We also assign weights to each candidate, prioritising them based on how many queries would benefit from those extended statistics and what is the execution cost of the queries are.
43
+
Weights are also assigned to each candidate, prioritized based on how many queries would benefit from those extended statistics and the execution cost of the queries.
44
44
45
45
See [Using EDB Query Advisor](using/#query_advisor_statistics_recommendationsmin_err_estimate_num-min_err_estimate_ratio) for a description of the `query_advisor_statistics_recommendations` function you can use to generate the statistics recommendation.
By default, only predicates filtering at least 1000 rows and 30% of the rows in average are considered. You can use the `min_filter` and `min_selectivity` parameters to override the default.
This function recommends potentially useful extended statistics by analyzing the statistics collected from the quals of user queries.
32
+
Recommends potentially useful extended statistics by analyzing the statistics collected from the quals of user queries.
33
33
34
34
By default, `min_err_estimate_num` and `min_err_estimate_ratio` are set to `0`. You can use the `min_err_estimate_num` and `min_err_estimate_ratio` parameters to override the default.
35
35
@@ -52,7 +52,7 @@ __OUTPUT__
52
52
```
53
53
54
54
### query_advisor_qualstat
55
-
This function returns the counts for every qualifier identified by the expression hash. This hash identifies each expression.
55
+
Returns the counts for every qualifier identified by the expression hash. This hash identifies each expression.
0 commit comments