Commit 3f19e17
committed
Have CLUSTER ignore partitions not owned by caller
If a partitioned table has partitions owned by roles other than the
owner of the partitioned table, don't include them in the to-be-
clustered list. This is similar to what VACUUM FULL does (except we do
it sooner, because there is no reason to postpone it). Add a simple
test to verify that only owned partitions are clustered.
While at it, change memory context switch-and-back to occur once per
partition instead of outside of the loop.
Author: Justin Pryzby <pryzby@telsasoft.com>
Reviewed-by: Zhihong Yu <zyu@yugabyte.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/20220411140609.GF26620@telsasoft.com1 parent 275e719 commit 3f19e17
File tree
3 files changed
+56
-7
lines changed- src
- backend/commands
- test/regress
- expected
- sql
3 files changed
+56
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1647 | 1647 | | |
1648 | 1648 | | |
1649 | 1649 | | |
1650 | | - | |
1651 | | - | |
1652 | 1650 | | |
1653 | | - | |
| 1651 | + | |
1654 | 1652 | | |
1655 | 1653 | | |
1656 | 1654 | | |
| |||
1663 | 1661 | | |
1664 | 1662 | | |
1665 | 1663 | | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | 1664 | | |
1670 | 1665 | | |
1671 | 1666 | | |
| |||
1676 | 1671 | | |
1677 | 1672 | | |
1678 | 1673 | | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
1679 | 1683 | | |
1680 | 1684 | | |
1681 | 1685 | | |
1682 | 1686 | | |
| 1687 | + | |
| 1688 | + | |
1683 | 1689 | | |
1684 | 1690 | | |
1685 | | - | |
1686 | 1691 | | |
1687 | 1692 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
496 | 521 | | |
497 | 522 | | |
498 | 523 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
232 | 251 | | |
233 | 252 | | |
234 | 253 | | |
| |||
0 commit comments