forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit32d3ed8
committed
Add path column to pg_backend_memory_contexts view
"path" provides a reliable method of determining the parent/childrelationships between memory contexts. Previously this could be done ina non-reliable way by writing a recursive query and joining the "parent"and "name" columns. This wasn't reliable as the names were not unique,which could result in joining to the wrong parent.To make this reliable, "path" stores an array of numerical identifiersstarting with the identifier for TopLevelMemoryContext. It contains anelement for each intermediate parent between that and the current context.Incompatibility: Here we also adjust the "level" column to make it1-based rather than 0-based. A 1-based level provides a convenient wayto access elements in the "path" array. e.g. path[level] gives theidentifier for the current context.Identifiers are not stable across multiple evaluations of the view. Inan attempt to make these more stable for ad-hoc queries, the identifiersare assigned breadth-first. Contexts closer to TopLevelMemoryContextare less likely to change between queries and during queries.Author: Melih Mutlu <m.melihmutlu@gmail.com>Discussion:https://postgr.es/m/CAGPVpCThLyOsj3e_gYEvLoHkr5w=tadDiN_=z2OwsK3VJppeBA@mail.gmail.comReviewed-by: Andres Freund, Stephen Frost, Atsushi Torikoshi,Reviewed-by: Michael Paquier, Robert Haas, David Rowley1 parent64c39bd commit32d3ed8
File tree
8 files changed
+225
-40
lines changed- doc/src/sgml
- src
- backend/utils/adt
- include
- catalog
- nodes
- test/regress
- expected
- sql
8 files changed
+225
-40
lines changedLines changed: 39 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
504 | 504 |
| |
505 | 505 |
| |
506 | 506 |
| |
507 |
| - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
508 | 523 |
| |
509 | 524 |
| |
510 | 525 |
| |
| |||
561 | 576 |
| |
562 | 577 |
| |
563 | 578 |
| |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
564 | 602 |
| |
565 | 603 |
| |
566 | 604 |
| |
|
Lines changed: 151 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| 22 | + | |
22 | 23 |
| |
| 24 | + | |
23 | 25 |
| |
24 | 26 |
| |
25 | 27 |
| |
26 | 28 |
| |
27 | 29 |
| |
28 | 30 |
| |
29 | 31 |
| |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
30 | 87 |
| |
31 | 88 |
| |
32 |
| - | |
| 89 | + | |
33 | 90 |
| |
34 | 91 |
| |
35 | 92 |
| |
36 | 93 |
| |
37 |
| - | |
| 94 | + | |
38 | 95 |
| |
39 |
| - | |
| 96 | + | |
40 | 97 |
| |
41 | 98 |
| |
42 | 99 |
| |
43 | 100 |
| |
44 |
| - | |
| 101 | + | |
45 | 102 |
| |
46 | 103 |
| |
47 | 104 |
| |
48 | 105 |
| |
49 | 106 |
| |
50 | 107 |
| |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 | 108 |
| |
55 |
| - | |
56 |
| - | |
| 109 | + | |
| 110 | + | |
57 | 111 |
| |
58 |
| - | |
| 112 | + | |
59 | 113 |
| |
60 |
| - | |
61 |
| - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
62 | 122 |
| |
63 | 123 |
| |
64 | 124 |
| |
65 | 125 |
| |
66 |
| - | |
| 126 | + | |
67 | 127 |
| |
68 | 128 |
| |
69 | 129 |
| |
70 | 130 |
| |
| 131 | + | |
| 132 | + | |
71 | 133 |
| |
72 | 134 |
| |
73 | 135 |
| |
| |||
92 | 154 |
| |
93 | 155 |
| |
94 | 156 |
| |
95 |
| - | |
96 |
| - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
97 | 166 |
| |
98 | 167 |
| |
99 | 168 |
| |
| |||
117 | 186 |
| |
118 | 187 |
| |
119 | 188 |
| |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
126 |
| - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
127 | 196 |
| |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
| 197 | + | |
| 198 | + | |
133 | 199 |
| |
134 | 200 |
| |
135 | 201 |
| |
| |||
140 | 206 |
| |
141 | 207 |
| |
142 | 208 |
| |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
143 | 222 |
| |
144 | 223 |
| |
145 |
| - | |
146 |
| - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 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 | + | |
147 | 269 |
| |
148 | 270 |
| |
149 | 271 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
60 |
| - | |
| 60 | + | |
61 | 61 |
| |
62 | 62 |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8290 | 8290 |
| |
8291 | 8291 |
| |
8292 | 8292 |
| |
8293 |
| - | |
8294 |
| - | |
8295 |
| - | |
| 8293 | + | |
| 8294 | + | |
| 8295 | + | |
8296 | 8296 |
| |
8297 | 8297 |
| |
8298 | 8298 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
128 | 128 |
| |
129 | 129 |
| |
130 | 130 |
| |
131 |
| - | |
132 |
| - | |
| 131 | + | |
| 132 | + | |
133 | 133 |
| |
134 | 134 |
| |
135 | 135 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1308 | 1308 |
| |
1309 | 1309 |
| |
1310 | 1310 |
| |
| 1311 | + | |
1311 | 1312 |
| |
1312 | 1313 |
| |
1313 | 1314 |
| |
1314 | 1315 |
| |
1315 | 1316 |
| |
1316 |
| - | |
| 1317 | + | |
1317 | 1318 |
| |
1318 | 1319 |
| |
1319 | 1320 |
| |
|
Lines changed: 16 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
| 25 | + | |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
| 28 | + | |
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| |||
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
54 | 68 |
| |
55 | 69 |
| |
56 | 70 |
| |
|
0 commit comments
Comments
(0)