- Notifications
You must be signed in to change notification settings - Fork5
Commitad43447
committed
This patch addresses some issues in TOAST compression strategy that
were discussed last year, but we felt it was too late in the 8.3 cycle tochange the code immediately. Specifically, the patch:* Reduces the minimum datum size to be considered for compression from256 to 32 bytes, as suggested by Greg Stark.* Increases the required compression rate for compressed storage from20% to 25%, again per Greg's suggestion.* Replaces force_input_size (size above which compression is forced)with a maximum size to be considered for compression. It was agreedthat allowing large inputs to escape the minimum-compression-raterequirement was not bright, and that indeed we'd rather have a knobthat acted in the other direction. I set this value to 1MB for themoment, but it could use some performance studies to tune it.* Adds an early-failure path to the compressor as suggested by Jan:if it's been unable to find even one compressible substring in thefirst 1KB (parameterizable), assume we're looking at incompressibleinput and give up. (Possibly this logic can be improved, but I'llcommit it as-is for now.)* Improves the toasting heuristics so that when we have very largefields with attstorage 'x' or 'e', we will push those out to toaststorage before considering inline compression of shorter fields.This also responds to a suggestion of Greg's, though my originalproposal for a solution was a bit off base because it didn't fixthe problem for large 'e' fields.There was some discussion in the earlier threads of exposing someof the compression knobs to users, perhaps even on a per-columnbasis. I have not done anything about that here. It seems to methat if we are changing around the parameters, we'd better get someexperience and be sure we are happy with the design before we setthings in stone by providing user-visible knobs.1 parent1cc5290 commitad43447
File tree
3 files changed
+141
-102
lines changed- src
- backend
- access/heap
- utils/adt
- include/utils
3 files changed
+141
-102
lines changedLines changed: 66 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
576 | 576 |
| |
577 | 577 |
| |
578 | 578 |
| |
579 |
| - | |
| 579 | + | |
| 580 | + | |
580 | 581 |
| |
581 | 582 |
| |
582 | 583 |
| |
| |||
595 | 596 |
| |
596 | 597 |
| |
597 | 598 |
| |
598 |
| - | |
| 599 | + | |
| 600 | + | |
599 | 601 |
| |
600 | 602 |
| |
601 | 603 |
| |
| |||
606 | 608 |
| |
607 | 609 |
| |
608 | 610 |
| |
609 |
| - | |
| 611 | + | |
610 | 612 |
| |
611 | 613 |
| |
612 | 614 |
| |
| |||
616 | 618 |
| |
617 | 619 |
| |
618 | 620 |
| |
619 |
| - | |
| 621 | + | |
620 | 622 |
| |
621 | 623 |
| |
622 | 624 |
| |
| |||
629 | 631 |
| |
630 | 632 |
| |
631 | 633 |
| |
632 |
| - | |
| 634 | + | |
633 | 635 |
| |
634 | 636 |
| |
635 |
| - | |
636 |
| - | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
637 | 641 |
| |
638 |
| - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
639 | 660 |
| |
640 |
| - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
641 | 680 |
| |
642 | 681 |
| |
643 |
| - | |
644 | 682 |
| |
645 |
| - | |
646 | 683 |
| |
647 | 684 |
| |
648 | 685 |
| |
649 |
| - | |
650 |
| - | |
651 |
| - | |
652 |
| - | |
653 |
| - | |
654 |
| - | |
655 |
| - | |
656 | 686 |
| |
657 | 687 |
| |
658 | 688 |
| |
| |||
761 | 791 |
| |
762 | 792 |
| |
763 | 793 |
| |
764 |
| - | |
765 |
| - | |
766 |
| - | |
| 794 | + | |
767 | 795 |
| |
768 | 796 |
| |
769 | 797 |
| |
| |||
1047 | 1075 |
| |
1048 | 1076 |
| |
1049 | 1077 |
| |
1050 |
| - | |
1051 |
| - | |
| 1078 | + | |
| 1079 | + | |
1052 | 1080 |
| |
1053 |
| - | |
| 1081 | + | |
| 1082 | + | |
1054 | 1083 |
| |
1055 | 1084 |
| |
1056 | 1085 |
| |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
1057 | 1097 |
| |
1058 | 1098 |
| |
1059 |
| - | |
| 1099 | + | |
1060 | 1100 |
| |
1061 | 1101 |
| |
1062 | 1102 |
| |
|
Lines changed: 58 additions & 48 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
169 |
| - | |
| 169 | + | |
170 | 170 |
| |
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
174 |
| - | |
175 |
| - | |
| 174 | + | |
176 | 175 |
| |
177 | 176 |
| |
178 | 177 |
| |
| |||
211 | 210 |
| |
212 | 211 |
| |
213 | 212 |
| |
214 |
| - | |
215 |
| - | |
216 |
| - | |
217 |
| - | |
218 |
| - | |
219 |
| - | |
220 |
| - | |
221 |
| - | |
222 |
| - | |
223 |
| - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
224 | 219 |
| |
225 | 220 |
| |
226 | 221 |
| |
227 | 222 |
| |
228 | 223 |
| |
229 |
| - | |
230 |
| - | |
231 |
| - | |
232 |
| - | |
233 |
| - | |
234 |
| - | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
235 | 230 |
| |
236 | 231 |
| |
237 | 232 |
| |
| |||
491 | 486 |
| |
492 | 487 |
| |
493 | 488 |
| |
| 489 | + | |
494 | 490 |
| |
495 | 491 |
| |
496 | 492 |
| |
| |||
506 | 502 |
| |
507 | 503 |
| |
508 | 504 |
| |
509 |
| - | |
510 |
| - | |
| 505 | + | |
| 506 | + | |
511 | 507 |
| |
512 | 508 |
| |
513 |
| - | |
| 509 | + | |
| 510 | + | |
514 | 511 |
| |
515 | 512 |
| |
516 | 513 |
| |
| |||
519 | 516 |
| |
520 | 517 |
| |
521 | 518 |
| |
522 |
| - | |
| 519 | + | |
523 | 520 |
| |
524 |
| - | |
| 521 | + | |
| 522 | + | |
525 | 523 |
| |
526 |
| - | |
| 524 | + | |
527 | 525 |
| |
528 | 526 |
| |
529 |
| - | |
| 527 | + | |
| 528 | + | |
530 | 529 |
| |
531 |
| - | |
| 530 | + | |
532 | 531 |
| |
533 | 532 |
| |
534 |
| - | |
535 |
| - | |
536 |
| - | |
537 |
| - | |
538 |
| - | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
539 | 538 |
| |
540 | 539 |
| |
541 |
| - | |
542 |
| - | |
543 |
| - | |
544 |
| - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
545 | 543 |
| |
546 |
| - | |
547 |
| - | |
548 |
| - | |
| 544 | + | |
549 | 545 |
| |
550 |
| - | |
551 |
| - | |
552 |
| - | |
553 |
| - | |
554 |
| - | |
555 |
| - | |
| 546 | + | |
| 547 | + | |
556 | 548 |
| |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
557 | 557 |
| |
558 | 558 |
| |
559 | 559 |
| |
| |||
570 | 570 |
| |
571 | 571 |
| |
572 | 572 |
| |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
573 | 582 |
| |
574 | 583 |
| |
575 | 584 |
| |
| |||
586 | 595 |
| |
587 | 596 |
| |
588 | 597 |
| |
589 |
| - | |
| 598 | + | |
590 | 599 |
| |
591 | 600 |
| |
| 601 | + | |
592 | 602 |
| |
593 | 603 |
| |
594 | 604 |
| |
| |||
599 | 609 |
| |
600 | 610 |
| |
601 | 611 |
| |
602 |
| - | |
| 612 | + | |
603 | 613 |
| |
604 | 614 |
| |
605 | 615 |
| |
|
0 commit comments
Comments
(0)