forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit62ddf7e
committed
Add ONLY support for VACUUM and ANALYZE
Since autovacuum does not trigger an ANALYZE for partitioned tables,users must perform these manually. However, performing a manual ANALYZEon a partitioned table would always result in recursively analyzing eachpartition and that could be undesirable as autovacuum takes care of that.For partitioned tables that contain a large number of partitions, havingto analyze each partition could take an unreasonably long time, especiallyso for tables with a large number of columns.Here we allow the ONLY keyword to prefix the name of the table to allowusers to have ANALYZE skip processing partitions. This option can alsobe used with VACUUM, but there is no work to do if VACUUM ONLY is used ona partitioned table.This commit also changes the behavior of VACUUMand ANALYZE forinheritance parents. Previously inheritance child tables would not beprocessed when operating on the parent. Now, by default we *do* operateon the child tables. ONLY can be used to obtain the old behavior.The release notes should note this as an incompatibility. The defaultbehavior has not changed for partitioned tables as these alwaysrecursively processed the partitions.Author: Michael Harris <harmic@gmail.com>Discussion:https://postgr.es/m/CADofcAWATx_haD=QkSxHbnTsAe6+e0Aw8Eh4H8cXyogGvn_kOg@mail.gmail.comDiscussion:https://postgr.es/m/CADofcAXVbD0yGp_EaC9chmzsOoSai3jcfBCnyva3j0RRdRvMVA@mail.gmail.comReviewed-by: Jelte Fennema-Nio <postgres@jeltef.nl>Reviewed-by: Melih Mutlu <m.melihmutlu@gmail.com>Reviewed-by: Atsushi Torikoshi <torikoshia@oss.nttdata.com>Reviewed-by: jian he <jian.universality@gmail.com>Reviewed-by: David Rowley <dgrowleyml@gmail.com>1 parentbbba59e commit62ddf7e
File tree
8 files changed
+230
-45
lines changed- doc/src/sgml
- ref
- src
- backend
- commands
- parser
- test/regress
- expected
- sql
8 files changed
+230
-45
lines changedLines changed: 13 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3778 | 3778 |
| |
3779 | 3779 |
| |
3780 | 3780 |
| |
3781 |
| - | |
3782 |
| - | |
3783 |
| - | |
3784 |
| - | |
3785 |
| - | |
3786 |
| - | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
3787 | 3789 |
| |
3788 | 3790 |
| |
3789 | 3791 |
| |
| |||
4854 | 4856 |
| |
4855 | 4857 |
| |
4856 | 4858 |
| |
4857 |
| - | |
4858 |
| - | |
4859 |
| - | |
| 4859 | + | |
| 4860 | + | |
| 4861 | + | |
| 4862 | + | |
4860 | 4863 |
| |
4861 |
| - | |
| 4864 | + | |
4862 | 4865 |
| |
4863 | 4866 |
| |
4864 | 4867 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5525 | 5525 |
| |
5526 | 5526 |
| |
5527 | 5527 |
| |
5528 |
| - | |
5529 |
| - | |
5530 |
| - | |
| 5528 | + | |
| 5529 | + | |
| 5530 | + | |
5531 | 5531 |
| |
5532 | 5532 |
| |
5533 | 5533 |
| |
|
Lines changed: 20 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
34 |
| - | |
| 34 | + | |
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
| |||
142 | 142 |
| |
143 | 143 |
| |
144 | 144 |
| |
145 |
| - | |
146 |
| - | |
147 |
| - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
148 | 151 |
| |
149 | 152 |
| |
150 | 153 |
| |
| |||
284 | 287 |
| |
285 | 288 |
| |
286 | 289 |
| |
287 |
| - | |
288 |
| - | |
289 |
| - | |
290 |
| - | |
291 |
| - | |
292 |
| - | |
293 |
| - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
294 | 299 |
| |
295 | 300 |
| |
296 | 301 |
| |
297 | 302 |
| |
298 |
| - | |
299 |
| - | |
300 |
| - | |
301 |
| - | |
302 |
| - | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
303 | 307 |
| |
304 | 308 |
| |
305 | 309 |
| |
|
Lines changed: 8 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
| 45 | + | |
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| |||
401 | 401 |
| |
402 | 402 |
| |
403 | 403 |
| |
404 |
| - | |
405 |
| - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
406 | 411 |
| |
407 | 412 |
| |
408 | 413 |
| |
|
Lines changed: 27 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
851 | 851 |
| |
852 | 852 |
| |
853 | 853 |
| |
854 |
| - | |
| 854 | + | |
855 | 855 |
| |
856 | 856 |
| |
857 | 857 |
| |
| |||
879 | 879 |
| |
880 | 880 |
| |
881 | 881 |
| |
882 |
| - | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
883 | 886 |
| |
884 | 887 |
| |
885 | 888 |
| |
886 |
| - | |
| 889 | + | |
| 890 | + | |
887 | 891 |
| |
888 | 892 |
| |
889 | 893 |
| |
| |||
944 | 948 |
| |
945 | 949 |
| |
946 | 950 |
| |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
947 | 962 |
| |
948 |
| - | |
949 | 963 |
| |
950 | 964 |
| |
951 | 965 |
| |
952 |
| - | |
953 |
| - | |
954 |
| - | |
955 |
| - | |
956 |
| - | |
957 |
| - | |
958 |
| - | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
959 | 974 |
| |
960 |
| - | |
| 975 | + | |
961 | 976 |
| |
962 | 977 |
| |
963 | 978 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11921 | 11921 |
| |
11922 | 11922 |
| |
11923 | 11923 |
| |
11924 |
| - | |
| 11924 | + | |
11925 | 11925 |
| |
11926 | 11926 |
| |
11927 | 11927 |
| |
|
Lines changed: 92 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
291 | 291 |
| |
292 | 292 |
| |
293 | 293 |
| |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
294 | 386 |
| |
295 | 387 |
| |
296 | 388 |
| |
|
Lines changed: 66 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
233 | 233 |
| |
234 | 234 |
| |
235 | 235 |
| |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
236 | 302 |
| |
237 | 303 |
| |
238 | 304 |
| |
|
0 commit comments
Comments
(0)