forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0fe5f64
committed
Teach radix tree to embed values at runtime
Previously, the decision to store values in leaves or within the childpointer was made at compile time, with variable length values usingleaves by necessity. This commit allows introspecting the length ofvariable length values at runtime for that decision. This requiresthe ability to tell whether the last-level child pointer is actuallya value, so we use a pointer tag in the lowest level bit.Use this in TID store. This entails adding a byte to the header toreserve space for the tag. Commitf35bd9b stores up to three offsetswithin the header with no bitmap, and now the header can be embeddedas above. This reduces worst-case memory usage when TIDs are sparse.Reviewed (in an earlier version) by Masahiko SawadaDiscussion:https://postgr.es/m/CANWCAZYw+_KAaUNruhJfE=h6WgtBKeDG32St8vBJBEY82bGVRQ@mail.gmail.comDiscussion:https://postgr.es/m/CAD21AoBci3Hujzijubomo1tdwH3XtQ9F89cTNQ4bsQijOmqnEw@mail.gmail.com1 parentf35bd9b commit0fe5f64
2 files changed
+89
-24
lines changedLines changed: 57 additions & 24 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
35 | 35 |
| |
36 | 36 |
| |
37 | 37 |
| |
38 |
| - | |
| 38 | + | |
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
47 |
| - | |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
| 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 | + | |
53 | 76 |
| |
54 | 77 |
| |
55 | 78 |
| |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
56 | 87 |
| |
57 | 88 |
| |
58 |
| - | |
| 89 | + | |
59 | 90 |
| |
60 | 91 |
| |
61 | 92 |
| |
| |||
64 | 95 |
| |
65 | 96 |
| |
66 | 97 |
| |
67 |
| - | |
| 98 | + | |
| 99 | + | |
68 | 100 |
| |
69 | 101 |
| |
70 | 102 |
| |
| |||
75 | 107 |
| |
76 | 108 |
| |
77 | 109 |
| |
78 |
| - | |
| 110 | + | |
| 111 | + | |
79 | 112 |
| |
80 | 113 |
| |
81 | 114 |
| |
| |||
350 | 383 |
| |
351 | 384 |
| |
352 | 385 |
| |
353 |
| - | |
| 386 | + | |
354 | 387 |
| |
355 | 388 |
| |
356 |
| - | |
| 389 | + | |
357 | 390 |
| |
358 | 391 |
| |
359 |
| - | |
| 392 | + | |
360 | 393 |
| |
361 | 394 |
| |
362 | 395 |
| |
| |||
371 | 404 |
| |
372 | 405 |
| |
373 | 406 |
| |
374 |
| - | |
| 407 | + | |
375 | 408 |
| |
376 | 409 |
| |
377 | 410 |
| |
| |||
385 | 418 |
| |
386 | 419 |
| |
387 | 420 |
| |
388 |
| - | |
389 |
| - | |
| 421 | + | |
| 422 | + | |
390 | 423 |
| |
391 | 424 |
| |
392 | 425 |
| |
| |||
414 | 447 |
| |
415 | 448 |
| |
416 | 449 |
| |
417 |
| - | |
| 450 | + | |
418 | 451 |
| |
419 | 452 |
| |
420 | 453 |
| |
421 | 454 |
| |
422 |
| - | |
| 455 | + | |
423 | 456 |
| |
424 | 457 |
| |
425 | 458 |
| |
| |||
430 | 463 |
| |
431 | 464 |
| |
432 | 465 |
| |
433 |
| - | |
| 466 | + | |
434 | 467 |
| |
435 | 468 |
| |
436 | 469 |
| |
| |||
554 | 587 |
| |
555 | 588 |
| |
556 | 589 |
| |
557 |
| - | |
| 590 | + | |
558 | 591 |
| |
559 | 592 |
| |
560 | 593 |
| |
561 | 594 |
| |
562 |
| - | |
563 |
| - | |
| 595 | + | |
| 596 | + | |
564 | 597 |
| |
565 | 598 |
| |
566 | 599 |
| |
567 | 600 |
| |
568 |
| - | |
| 601 | + | |
569 | 602 |
| |
570 | 603 |
| |
571 | 604 |
| |
|
Lines changed: 32 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
105 | 105 |
| |
106 | 106 |
| |
107 | 107 |
| |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
108 | 112 |
| |
109 | 113 |
| |
110 | 114 |
| |
| |||
437 | 441 |
| |
438 | 442 |
| |
439 | 443 |
| |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
440 | 448 |
| |
| 449 | + | |
| 450 | + | |
441 | 451 |
| |
442 | 452 |
| |
443 | 453 |
| |
| |||
451 | 461 |
| |
452 | 462 |
| |
453 | 463 |
| |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
454 | 474 |
| |
| 475 | + | |
| 476 | + | |
455 | 477 |
| |
456 | 478 |
| |
457 | 479 |
| |
| |||
1729 | 1751 |
| |
1730 | 1752 |
| |
1731 | 1753 |
| |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
1732 | 1763 |
| |
1733 | 1764 |
| |
1734 | 1765 |
| |
| |||
2888 | 2919 |
| |
2889 | 2920 |
| |
2890 | 2921 |
| |
| 2922 | + | |
2891 | 2923 |
| |
2892 | 2924 |
| |
2893 | 2925 |
| |
|
0 commit comments
Comments
(0)