forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit11a078c
committed
Optimize partial TOAST decompression
Commit4d0e994 added support for partial TOAST decompression, so thedecompression is interrupted after producing the requested prefix. Forprefix and slices near the beginning of the entry, this may saves a lotof decompression work.That however only deals with decompression - the whole compressed entrywas still fetched and re-assembled, even though the compression usedonly a small fraction of it. This commit improves that by computing howmuch compressed data may be needed to decompress the requested prefix,and then fetches only the necessary part.We always need to fetch a bit more compressed data than the requested(uncompressed) prefix, because the prefix may not be compressible at alland pglz itself adds a bit of overhead. That means this optimization ismost effective when the requested prefix is much smaller than the wholecompressed entry.Author: Binguo BaoReviewed-by: Andrey Borodin, Tomas Vondra, Paul RamseyDiscussion:https://www.postgresql.org/message-id/flat/CAL-OGkthU9Gs7TZchf5OWaL-Gsi=hXqufTxKv9qpNG73d5na_g@mail.gmail.com1 parent002962d commit11a078c
File tree
4 files changed
+86
-8
lines changed- src
- backend/access/common
- common
- include
- access
- common
4 files changed
+86
-8
lines changedLines changed: 46 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
196 | 196 |
| |
197 | 197 |
| |
198 | 198 |
| |
| 199 | + | |
| 200 | + | |
199 | 201 |
| |
200 | 202 |
| |
201 | 203 |
| |
| |||
217 | 219 |
| |
218 | 220 |
| |
219 | 221 |
| |
220 |
| - | |
221 |
| - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
222 | 246 |
| |
223 | 247 |
| |
224 | 248 |
| |
| |||
476 | 500 |
| |
477 | 501 |
| |
478 | 502 |
| |
479 |
| - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
480 | 506 |
| |
481 | 507 |
| |
482 | 508 |
| |
| |||
517 | 543 |
| |
518 | 544 |
| |
519 | 545 |
| |
520 |
| - | |
521 |
| - | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
522 | 549 |
| |
523 |
| - | |
| 550 | + | |
524 | 551 |
| |
525 | 552 |
| |
526 | 553 |
| |
| |||
531 | 558 |
| |
532 | 559 |
| |
533 | 560 |
| |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
534 | 569 |
| |
535 | 570 |
| |
536 | 571 |
| |
537 | 572 |
| |
538 | 573 |
| |
539 |
| - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
540 | 578 |
| |
541 | 579 |
| |
542 | 580 |
| |
| |||
720 | 758 |
| |
721 | 759 |
| |
722 | 760 |
| |
723 |
| - | |
| 761 | + | |
724 | 762 |
| |
725 | 763 |
| |
726 | 764 |
| |
|
Lines changed: 37 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
771 | 771 |
| |
772 | 772 |
| |
773 | 773 |
| |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + |
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
| 90 | + | |
| 91 | + | |
90 | 92 |
| |
91 | 93 |
|
0 commit comments
Comments
(0)