forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit5983a4c
committed
Introduce CompactAttribute array in TupleDesc, take 2
The new compact_attrs array stores a few select fields fromFormData_pg_attribute in a more compact way, using only 16 bytes percolumn instead of the 104 bytes that FormData_pg_attribute uses. UsingCompactAttribute allows performance-critical operations such as tupledeformation to be performed without looking at the FormData_pg_attributeelement in TupleDesc which means fewer cacheline accesses.For some workloads, tuple deformation can be the most CPU intensive partof processing the query. Some testing with 16 columns on a tablewhere the first column is variable length showed around a 10% increase intransactions per second for an OLAP type query performing aggregation onthe 16th column. However, in certain cases, the increases were muchhigher, up to ~25% on one AMD Zen4 machine.This also makes pg_attribute.attcacheoff redundant. A follow-on commitwill remove it, thus shrinking the FormData_pg_attribute struct by 4bytes.Author: David RowleyReviewed-by: Andres Freund, Victor YegorovDiscussion:https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.com1 parent8ac0021 commit5983a4c
File tree
44 files changed
+374
-154
lines changed- contrib
- amcheck
- pageinspect
- postgres_fdw
- src
- backend
- access
- brin
- common
- gin
- gist
- heap
- nbtree
- spgist
- table
- catalog
- commands
- executor
- jit/llvm
- optimizer/util
- replication/pgoutput
- utils
- adt
- cache
- include/access
- tools/pgindent
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+374
-154
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1571 | 1571 |
| |
1572 | 1572 |
| |
1573 | 1573 |
| |
1574 |
| - | |
| 1574 | + | |
1575 | 1575 |
| |
1576 | 1576 |
| |
1577 | 1577 |
| |
1578 |
| - | |
| 1578 | + | |
1579 | 1579 |
| |
1580 | 1580 |
| |
1581 | 1581 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
242 | 242 |
| |
243 | 243 |
| |
244 | 244 |
| |
245 |
| - | |
246 |
| - | |
| 245 | + | |
| 246 | + | |
247 | 247 |
| |
248 | 248 |
| |
249 | 249 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
334 | 334 |
| |
335 | 335 |
| |
336 | 336 |
| |
337 |
| - | |
| 337 | + | |
338 | 338 |
| |
339 | 339 |
| |
340 | 340 |
| |
341 |
| - | |
| 341 | + | |
342 | 342 |
| |
343 | 343 |
| |
344 | 344 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1818 | 1818 |
| |
1819 | 1819 |
| |
1820 | 1820 |
| |
1821 |
| - | |
| 1821 | + | |
1822 | 1822 |
| |
1823 | 1823 |
| |
1824 | 1824 |
| |
| |||
2191 | 2191 |
| |
2192 | 2192 |
| |
2193 | 2193 |
| |
2194 |
| - | |
| 2194 | + | |
2195 | 2195 |
| |
2196 | 2196 |
| |
2197 | 2197 |
| |
| |||
4311 | 4311 |
| |
4312 | 4312 |
| |
4313 | 4313 |
| |
4314 |
| - | |
| 4314 | + | |
4315 | 4315 |
| |
4316 | 4316 |
| |
4317 | 4317 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
146 | 146 |
| |
147 | 147 |
| |
148 | 148 |
| |
149 |
| - | |
| 149 | + | |
150 | 150 |
| |
151 | 151 |
| |
152 | 152 |
| |
153 | 153 |
| |
154 |
| - | |
| 154 | + | |
155 | 155 |
| |
156 | 156 |
| |
157 | 157 |
| |
| |||
479 | 479 |
| |
480 | 480 |
| |
481 | 481 |
| |
482 |
| - | |
| 482 | + | |
483 | 483 |
| |
484 | 484 |
| |
485 | 485 |
| |
486 | 486 |
| |
487 | 487 |
| |
488 | 488 |
| |
489 | 489 |
| |
490 |
| - | |
| 490 | + | |
491 | 491 |
| |
492 | 492 |
| |
493 | 493 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
699 | 699 |
| |
700 | 700 |
| |
701 | 701 |
| |
702 |
| - | |
| 702 | + | |
703 | 703 |
| |
704 | 704 |
| |
705 | 705 |
| |
|
Lines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
135 | 135 |
| |
136 | 136 |
| |
137 | 137 |
| |
138 |
| - | |
| 138 | + | |
139 | 139 |
| |
140 | 140 |
| |
141 | 141 |
| |
| |||
299 | 299 |
| |
300 | 300 |
| |
301 | 301 |
| |
302 |
| - | |
303 |
| - | |
| 302 | + | |
| 303 | + | |
304 | 304 |
| |
305 | 305 |
| |
306 | 306 |
| |
| |||
311 | 311 |
| |
312 | 312 |
| |
313 | 313 |
| |
| 314 | + | |
| 315 | + | |
314 | 316 |
| |
315 | 317 |
| |
316 | 318 |
| |
|
Lines changed: 28 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 |
| |
87 | 91 |
| |
88 | 92 |
| |
| |||
147 | 151 |
| |
148 | 152 |
| |
149 | 153 |
| |
150 |
| - | |
| 154 | + | |
151 | 155 |
| |
152 | 156 |
| |
153 | 157 |
| |
154 | 158 |
| |
155 |
| - | |
| 159 | + | |
156 | 160 |
| |
157 | 161 |
| |
158 | 162 |
| |
| |||
223 | 227 |
| |
224 | 228 |
| |
225 | 229 |
| |
226 |
| - | |
| 230 | + | |
227 | 231 |
| |
228 | 232 |
| |
229 | 233 |
| |
230 | 234 |
| |
231 | 235 |
| |
232 |
| - | |
| 236 | + | |
233 | 237 |
| |
234 |
| - | |
| 238 | + | |
235 | 239 |
| |
236 | 240 |
| |
237 | 241 |
| |
| |||
268 | 272 |
| |
269 | 273 |
| |
270 | 274 |
| |
271 |
| - | |
| 275 | + | |
272 | 276 |
| |
273 | 277 |
| |
274 | 278 |
| |
| |||
349 | 353 |
| |
350 | 354 |
| |
351 | 355 |
| |
352 |
| - | |
353 |
| - | |
| 356 | + | |
354 | 357 |
| |
355 | 358 |
| |
356 | 359 |
| |
| |||
427 | 430 |
| |
428 | 431 |
| |
429 | 432 |
| |
430 |
| - | |
| 433 | + | |
431 | 434 |
| |
432 | 435 |
| |
433 | 436 |
| |
| |||
461 | 464 |
| |
462 | 465 |
| |
463 | 466 |
| |
464 |
| - | |
| 467 | + | |
| 468 | + | |
465 | 469 |
| |
466 | 470 |
| |
467 | 471 |
| |
| |||
570 | 574 |
| |
571 | 575 |
| |
572 | 576 |
| |
573 |
| - | |
| 577 | + | |
574 | 578 |
| |
575 | 579 |
| |
576 | 580 |
| |
577 | 581 |
| |
578 | 582 |
| |
579 |
| - | |
| 583 | + | |
580 | 584 |
| |
581 | 585 |
| |
582 | 586 |
| |
| |||
591 | 595 |
| |
592 | 596 |
| |
593 | 597 |
| |
594 |
| - | |
| 598 | + | |
595 | 599 |
| |
596 | 600 |
| |
597 | 601 |
| |
| |||
614 | 618 |
| |
615 | 619 |
| |
616 | 620 |
| |
617 |
| - | |
| 621 | + | |
618 | 622 |
| |
619 | 623 |
| |
620 |
| - | |
| 624 | + | |
621 | 625 |
| |
622 | 626 |
| |
623 |
| - | |
624 |
| - | |
| 627 | + | |
| 628 | + | |
625 | 629 |
| |
626 | 630 |
| |
627 | 631 |
| |
628 |
| - | |
| 632 | + | |
629 | 633 |
| |
630 | 634 |
| |
631 | 635 |
| |
| |||
639 | 643 |
| |
640 | 644 |
| |
641 | 645 |
| |
642 |
| - | |
| 646 | + | |
643 | 647 |
| |
644 | 648 |
| |
645 | 649 |
| |
| |||
659 | 663 |
| |
660 | 664 |
| |
661 | 665 |
| |
662 |
| - | |
| 666 | + | |
663 | 667 |
| |
664 | 668 |
| |
665 | 669 |
| |
| |||
707 | 711 |
| |
708 | 712 |
| |
709 | 713 |
| |
710 |
| - | |
| 714 | + | |
711 | 715 |
| |
712 | 716 |
| |
713 | 717 |
| |
| |||
892 | 896 |
| |
893 | 897 |
| |
894 | 898 |
| |
895 |
| - | |
| 899 | + | |
896 | 900 |
| |
897 | 901 |
| |
898 | 902 |
| |
| |||
1020 | 1024 |
| |
1021 | 1025 |
| |
1022 | 1026 |
| |
1023 |
| - | |
1024 |
| - | |
| 1027 | + | |
1025 | 1028 |
| |
1026 | 1029 |
| |
1027 | 1030 |
| |
| |||
1370 | 1373 |
| |
1371 | 1374 |
| |
1372 | 1375 |
| |
1373 |
| - | |
| 1376 | + | |
1374 | 1377 |
| |
1375 | 1378 |
| |
1376 | 1379 |
| |
|
0 commit comments
Comments
(0)