Skip to content

Commit 5a83801

Browse files
authored
Merge pull request #6088 from EnterpriseDB/docs/edits_to_pgextension_pr6035
Edits to add stats recommendations function pgextensions pr6035
2 parents 1ed706a + 25765b9 commit 5a83801

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

advocacy_docs/pg_extensions/query_advisor/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ See [Using EDB Query Advisor](using/#query_advisor_index_recommendationsmin_filt
3434

3535
## Statistics Advisor
3636

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.
3838

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.
4040

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.
4242

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.
4444

4545
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.
4646

advocacy_docs/pg_extensions/query_advisor/using.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ EDB Query Advisor defines functions and views.
88
## Functions
99

1010
### query_advisor_index_recommendations(min_filter, min_selectivity)
11-
This function performs a global index suggestion.
11+
Performs a global index suggestion.
1212

1313
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.
1414

@@ -29,7 +29,7 @@ __OUTPUT__
2929
```
3030
### query_advisor_statistics_recommendations(min_err_estimate_num, min_err_estimate_ratio)
3131

32-
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.
3333

3434
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.
3535

@@ -52,7 +52,7 @@ __OUTPUT__
5252
```
5353

5454
### 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.
5656

5757
| Qualifier | Description | |
5858
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --- |
@@ -118,7 +118,7 @@ __OUTPUT__
118118

119119
### query_advisor_statistics_recommendations
120120

121-
It skips the weight column from `query_advisor_statistics_recommendations`.
121+
Skips the weight column from `query_advisor_statistics_recommendations`.
122122

123123
For example:
124124

0 commit comments

Comments
 (0)