- Notifications
You must be signed in to change notification settings - Fork5.3k
Commite76defb
committed
Rework output format of pg_dependencies
The existing format of pg_dependencies uses a single-object JSONstructure, with each key value embedding all the knowledge about theset attributes tracked, like:{"1 => 5": 1.000000, "5 => 1": 0.423130}While this is a very compact format, it is confusing to read and it isdifficult to manipulate the values within the object, particularly whentracking multiple attributes.The new output format introduced in this commit is a JSON array ofobjects, with:- A key named "degree", with a float value.- A key named "attributes", with an array of attribute numbers.- A key named "dependency", with an attribute number.The values use the same underlying type as previously when printed, witha new output format that shows now as follows:[{"degree": 1.000000, "attributes": [1], "dependency": 5}, {"degree": 0.423130, "attributes": [5], "dependency": 1}]This new format will become handy for a follow-up set of changes, so asit becomes possible to inject extended statistics rather than require anANALYZE, like in a dump/restore sequence or after pg_upgrade on a newcluster.This format has been suggested by Tomas Vondra. The key names aredefined in the header introduced by1f927cc, to ease theintegration of frontend-specific changes that are still underdiscussion. (Again a personal note: if anybody comes up with bettername for the keys, of course feel free.)The bulk of the changes come from the regression tests, wherejsonb_pretty() is now used to make the outputs generated easier toparse.Author: Corey Huinker <corey.huinker@gmail.com>Reviewed-by: Jian He <jian.universality@gmail.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com1 parent1f927cc commite76defb
File tree
5 files changed
+142
-33
lines changed- doc/src/sgml
- src
- backend/utils/adt
- include/statistics
- test/regress
- expected
- sql
5 files changed
+142
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1485 | 1485 | | |
1486 | 1486 | | |
1487 | 1487 | | |
1488 | | - | |
1489 | | - | |
| 1488 | + | |
| 1489 | + | |
1490 | 1490 | | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
1494 | 1509 | | |
1495 | 1510 | | |
1496 | 1511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | | - | |
50 | | - | |
51 | 50 | | |
52 | 51 | | |
53 | 52 | | |
54 | | - | |
| 53 | + | |
55 | 54 | | |
56 | | - | |
| 55 | + | |
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
32 | 47 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
1433 | 1434 | | |
1434 | 1435 | | |
1435 | 1436 | | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
1439 | | - | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
1440 | 1479 | | |
1441 | 1480 | | |
1442 | 1481 | | |
| |||
1775 | 1814 | | |
1776 | 1815 | | |
1777 | 1816 | | |
1778 | | - | |
1779 | | - | |
1780 | | - | |
1781 | | - | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
1782 | 1859 | | |
1783 | 1860 | | |
1784 | 1861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
| 129 | + | |
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| |||
708 | 709 | | |
709 | 710 | | |
710 | 711 | | |
711 | | - | |
| 712 | + | |
712 | 713 | | |
713 | 714 | | |
714 | 715 | | |
| |||
844 | 845 | | |
845 | 846 | | |
846 | 847 | | |
847 | | - | |
| 848 | + | |
848 | 849 | | |
849 | 850 | | |
850 | 851 | | |
| |||
0 commit comments
Comments
(0)