Commit 3ead998
committed
Fix: Prevent excessive sampling on QEs by restricting ComputeExtStatisticsRows to QD
In `do_analyze_rel`, the function `ComputeExtStatisticsRows` calculates the minimum
number of sample rows needed for extended statistics (e.g., dependencies, ndistinct).
This calculation is only meaningful and required on the Query Dispatcher (QD), since
only the QD is responsible for coordinating the final extended statistics generation.
Previously, all segments (including QEs) executed this logic, resulting in excessive
sampling. For large tables, this caused the QD to receive more rows than it can handle,
leading to the error:
ERROR: too many sample rows received from gp_acquire_sample_rows1 parent 39ef2bd commit 3ead998
File tree
4 files changed
+42
-2
lines changed- src
- backend/commands
- test/regress
- expected
- sql
4 files changed
+42
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
717 | 717 | | |
718 | 718 | | |
719 | 719 | | |
720 | | - | |
721 | | - | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
722 | 724 | | |
723 | 725 | | |
724 | 726 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3240 | 3240 | | |
3241 | 3241 | | |
3242 | 3242 | | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
| 3250 | + | |
| 3251 | + | |
| 3252 | + | |
| 3253 | + | |
| 3254 | + | |
| 3255 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3275 | 3275 | | |
3276 | 3276 | | |
3277 | 3277 | | |
| 3278 | + | |
| 3279 | + | |
| 3280 | + | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
| 3284 | + | |
| 3285 | + | |
| 3286 | + | |
| 3287 | + | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1651 | 1651 | | |
1652 | 1652 | | |
1653 | 1653 | | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
0 commit comments