forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd28dff3
committed
Introduce CompactAttribute array in TupleDesc
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. With thischange, NAMEDATALEN could be increased with a much smaller negative impacton performance.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 RowleyDiscussion:https://postgr.es/m/CAApHDvrBztXP3yx=NKNmo3xwFAFhEdyPnvrDg3=M0RhDs+4vYw@mail.gmail.comReviewed-by: Andres Freund, Victor Yegorov1 parente4c8865 commitd28dff3
File tree
14 files changed
+246
-68
lines changed- src
- backend
- access
- common
- spgist
- catalog
- commands
- executor
- utils/cache
- include/access
- tools/pgindent
14 files changed
+246
-68
lines changed| 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
| 356 | + | |
| 357 | + | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
| 375 | + | |
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
| 443 | + | |
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
| 493 | + | |
494 | 494 | | |
495 | 495 | | |
496 | 496 | | |
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
591 | | - | |
| 591 | + | |
592 | 592 | | |
593 | 593 | | |
594 | 594 | | |
| |||
0 commit comments
Comments
(0)