forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit161320b
committed
Adjust EXPLAIN's output for disabled nodes
c01743a added EXPLAIN output to display the plan node's disabled_nodecount whenever that count is above 0. Seemingly, there weren't manypeople who liked that output as each parent of a disabled node wouldalso have a "Disabled Nodes" output due to the way disabled_nodes isaccumulated towards the root plan node. It was often hard and sometimesimpossible to figure out which nodes were disabled from looking atEXPLAIN. You might think it would be possible to manually add up thenumbers from the "Disabled Nodes" output of a given node's children tofigure out if that node has a higher disabled_nodes count than itschildren, but that wouldn't have worked for Append and Merge Append nodesif some disabled child nodes were run-time pruned during init plan. Thosechildren are not displayed in EXPLAIN.Here we attempt to improve this output by only showing "Disabled: true"against only the nodes which are explicitly disabled themselves. Thatseems to be the output that's desired by the most people who voicedtheir opinion. This is done by summing up the disabled_nodes of thegiven node's children and checking if that number is less than thedisabled_nodes of the current node.This commit also fixes a bug in make_sort() which was neglecting to setthe Sort's disabled_nodes field. This should have copied what was donein cost_sort(), but it hadn't been updated. With the new output, thechoice to not maintain that field properly was clearly wrong as thedisabled-ness of the node was attributed to the Sort's parent instead.Reviewed-by: Laurenz Albe, Alena RybakinaDiscussion:https://postgr.es/m/9e4ad616bebb103ec2084bf6f724cfc739e7fabb.camel@cybertec.at1 parentc75c6f8 commit161320b
File tree
17 files changed
+147
-50
lines changed- src
- backend
- commands
- optimizer/plan
- test/regress/expected
17 files changed
+147
-50
lines changedLines changed: 95 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1363 | 1363 |
| |
1364 | 1364 |
| |
1365 | 1365 |
| |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
1366 | 1456 |
| |
1367 | 1457 |
| |
1368 | 1458 |
| |
| |||
1399 | 1489 |
| |
1400 | 1490 |
| |
1401 | 1491 |
| |
| 1492 | + | |
1402 | 1493 |
| |
1403 | 1494 |
| |
1404 | 1495 |
| |
| |||
1914 | 2005 |
| |
1915 | 2006 |
| |
1916 | 2007 |
| |
1917 |
| - | |
1918 |
| - | |
1919 |
| - | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
1920 | 2012 |
| |
1921 | 2013 |
| |
1922 | 2014 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6149 | 6149 |
| |
6150 | 6150 |
| |
6151 | 6151 |
| |
| 6152 | + | |
6152 | 6153 |
| |
6153 | 6154 |
| |
6154 | 6155 |
| |
|
Lines changed: 9 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2944 | 2944 |
| |
2945 | 2945 |
| |
2946 | 2946 |
| |
2947 |
| - | |
2948 | 2947 |
| |
2949 | 2948 |
| |
2950 |
| - | |
2951 | 2949 |
| |
2952 | 2950 |
| |
2953 |
| - | |
2954 | 2951 |
| |
2955 | 2952 |
| |
2956 | 2953 |
| |
2957 | 2954 |
| |
2958 |
| - | |
| 2955 | + | |
2959 | 2956 |
| |
2960 | 2957 |
| |
2961 | 2958 |
| |
2962 |
| - | |
2963 |
| - | |
| 2959 | + | |
| 2960 | + | |
2964 | 2961 |
| |
2965 | 2962 |
| |
2966 | 2963 |
| |
| |||
2982 | 2979 |
| |
2983 | 2980 |
| |
2984 | 2981 |
| |
2985 |
| - | |
2986 | 2982 |
| |
2987 | 2983 |
| |
2988 |
| - | |
2989 | 2984 |
| |
2990 | 2985 |
| |
2991 | 2986 |
| |
2992 |
| - | |
2993 | 2987 |
| |
2994 | 2988 |
| |
2995 | 2989 |
| |
2996 | 2990 |
| |
2997 |
| - | |
| 2991 | + | |
2998 | 2992 |
| |
2999 | 2993 |
| |
3000 | 2994 |
| |
3001 |
| - | |
3002 |
| - | |
| 2995 | + | |
| 2996 | + | |
3003 | 2997 |
| |
3004 | 2998 |
| |
3005 | 2999 |
| |
| |||
3009 | 3003 |
| |
3010 | 3004 |
| |
3011 | 3005 |
| |
3012 |
| - | |
3013 | 3006 |
| |
3014 | 3007 |
| |
3015 |
| - | |
3016 | 3008 |
| |
3017 | 3009 |
| |
3018 | 3010 |
| |
3019 |
| - | |
3020 | 3011 |
| |
3021 | 3012 |
| |
3022 | 3013 |
| |
3023 | 3014 |
| |
3024 |
| - | |
| 3015 | + | |
3025 | 3016 |
| |
3026 | 3017 |
| |
3027 | 3018 |
| |
3028 |
| - | |
3029 |
| - | |
| 3019 | + | |
| 3020 | + | |
3030 | 3021 |
| |
3031 | 3022 |
| |
3032 | 3023 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
335 | 335 |
| |
336 | 336 |
| |
337 | 337 |
| |
338 |
| - | |
339 | 338 |
| |
340 | 339 |
| |
341 |
| - | |
| 340 | + | |
342 | 341 |
| |
343 |
| - | |
| 342 | + | |
344 | 343 |
| |
345 | 344 |
| |
346 | 345 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
989 | 989 |
| |
990 | 990 |
| |
991 | 991 |
| |
992 |
| - | |
| 992 | + | |
993 | 993 |
| |
994 | 994 |
| |
995 | 995 |
| |
| |||
1005 | 1005 |
| |
1006 | 1006 |
| |
1007 | 1007 |
| |
1008 |
| - | |
| 1008 | + | |
1009 | 1009 |
| |
1010 | 1010 |
| |
1011 | 1011 |
| |
|
Lines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
104 | 104 |
| |
105 | 105 |
| |
106 | 106 |
| |
| 107 | + | |
107 | 108 |
| |
108 | 109 |
| |
109 | 110 |
| |
| |||
152 | 153 |
| |
153 | 154 |
| |
154 | 155 |
| |
| 156 | + | |
155 | 157 |
| |
156 | 158 |
| |
157 | 159 |
| |
| |||
213 | 215 |
| |
214 | 216 |
| |
215 | 217 |
| |
| 218 | + | |
216 | 219 |
| |
217 | 220 |
| |
218 | 221 |
| |
| |||
262 | 265 |
| |
263 | 266 |
| |
264 | 267 |
| |
| 268 | + | |
265 | 269 |
| |
266 | 270 |
| |
267 | 271 |
| |
| |||
370 | 374 |
| |
371 | 375 |
| |
372 | 376 |
| |
| 377 | + | |
373 | 378 |
| |
374 | 379 |
| |
375 | 380 |
| |
| |||
394 | 399 |
| |
395 | 400 |
| |
396 | 401 |
| |
397 |
| - | |
| 402 | + | |
| 403 | + | |
398 | 404 |
| |
399 | 405 |
| |
400 | 406 |
| |
| |||
497 | 503 |
| |
498 | 504 |
| |
499 | 505 |
| |
| 506 | + | |
500 | 507 |
| |
501 | 508 |
| |
502 | 509 |
| |
| |||
540 | 547 |
| |
541 | 548 |
| |
542 | 549 |
| |
| 550 | + | |
543 | 551 |
| |
544 | 552 |
| |
545 | 553 |
| |
| |||
586 | 594 |
| |
587 | 595 |
| |
588 | 596 |
| |
| 597 | + | |
589 | 598 |
| |
590 | 599 |
| |
591 | 600 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
538 | 538 |
| |
539 | 539 |
| |
540 | 540 |
| |
| 541 | + | |
541 | 542 |
| |
542 | 543 |
| |
543 | 544 |
| |
| |||
701 | 702 |
| |
702 | 703 |
| |
703 | 704 |
| |
704 |
| - | |
705 | 705 |
| |
706 | 706 |
| |
707 | 707 |
| |
708 | 708 |
| |
709 |
| - | |
710 | 709 |
| |
711 | 710 |
| |
712 | 711 |
| |
713 |
| - | |
| 712 | + | |
714 | 713 |
| |
715 | 714 |
| |
716 |
| - | |
| 715 | + | |
717 | 716 |
| |
718 | 717 |
| |
719 | 718 |
| |
| |||
744 | 743 |
| |
745 | 744 |
| |
746 | 745 |
| |
| 746 | + | |
747 | 747 |
| |
748 | 748 |
| |
749 | 749 |
| |
|
Lines changed: 2 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1614 | 1614 |
| |
1615 | 1615 |
| |
1616 | 1616 |
| |
1617 |
| - | |
1618 | 1617 |
| |
1619 | 1618 |
| |
1620 | 1619 |
| |
| |||
1624 | 1623 |
| |
1625 | 1624 |
| |
1626 | 1625 |
| |
1627 |
| - | |
| 1626 | + | |
1628 | 1627 |
| |
1629 | 1628 |
| |
1630 | 1629 |
| |
1631 |
| - | |
| 1630 | + | |
1632 | 1631 |
| |
1633 | 1632 |
| |
1634 | 1633 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
| 221 | + | |
221 | 222 |
| |
222 | 223 |
| |
223 | 224 |
| |
| |||
226 | 227 |
| |
227 | 228 |
| |
228 | 229 |
| |
229 |
| - | |
| 230 | + | |
| 231 | + | |
230 | 232 |
| |
231 | 233 |
| |
232 | 234 |
| |
|
0 commit comments
Comments
(0)