Re: [HACKERS] Custom compression methods (mac+lz4.h)
Tom Lane <tgl@sss.pgh.pa.us>
Robert Haas <robertmhaas@gmail.com> writes: > On Mon, Mar 22, 2021 at 10:41 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Yeah, I thought about that too, but do we want to assume that >> VARRAWSIZE_4B_C is the correct way to get the decompressed size >> for all compression methods? > I think it's OK to assume this. OK, cool. >> (If so, I think it would be better style to have a less opaque macro >> name for the purpose.) > Complaining about the name of one particular TOAST-related macro name > seems a bit like complaining about the greenhouse gasses emitted by > one particular car. Maybe, but that's not a reason to make it worse. Anyway, my understanding of that is that the really opaque names are *only* meant to be used in this very stretch of postgres.h, ie they are just intermediate steps on the way to the macros below them. As an example, the only use of VARDATA_1B_E() is in VARDATA_EXTERNAL(). > Anyway, this particular macro name was chosen, it seems, for symmetry > with VARDATA_4B_C, but if you want to change it to something else, I'm > OK with that, too. After looking at postgres.h for a bit, I'm thinking that what these should have been symmetric with is the considerably-less-terrible names used for the corresponding VARATT_EXTERNAL cases. Thus, something like s/VARRAWSIZE_4B_C/VARDATA_COMPRESSED_GET_RAWSIZE/ s/VARCOMPRESS_4B_C/VARDATA_COMPRESSED_GET_COMPRESSION/ Possibly the former names should survive and the latter become wrappers around them, not sure. But we shouldn't be using the "4B" terminology anyplace except this part of postgres.h. regards, tom lane
Commits
-
docs: Update TOAST storage docs for configurable compression.
- e8c435a824e1 14.0 landed
-
Further tweaking of pg_dump's handling of default_toast_compression.
- 54bb91c30e39 14.0 landed
-
Fix interaction of TOAST compression with expression indexes.
- 5db1fd7823a1 14.0 landed
-
Tidy up more loose ends related to configurable TOAST compression.
- e5595de03ec6 14.0 landed
-
Short-circuit slice requests that are for more than the object's size.
- 063dd37ebc76 14.0 landed
-
Mostly-cosmetic adjustments of TOAST-related macros.
- aeb1631ed207 14.0 landed
-
Remove useless configure probe for <lz4/lz4.h>.
- 2c75f8a612b2 14.0 landed
-
Error on invalid TOAST compression in CREATE or ALTER TABLE.
- a4d5284a10b5 14.0 landed
-
docs: Fix omissions related to configurable TOAST compression.
- 24f0e395ac58 14.0 landed
-
More code cleanup for configurable TOAST compression.
- 226e2be3876d 14.0 landed
-
Bring configure support for LZ4 up to snuff.
- 4d399a6fbeb7 14.0 landed
-
Make compression.sql regression test independent of default.
- fd1ac9a54896 14.0 landed
-
Use valid compression method in brin_form_tuple
- 882b2cdc08c4 14.0 landed
-
Fix up pg_dump's handling of per-attribute compression options.
- aa25d1089ac0 14.0 landed
-
Allow configurable LZ4 TOAST compression.
- bbe0a81db69b 14.0 landed
-
Fix inconsistencies in the code
- 6b8548964bcc 13.0 cited
-
Mostly-cosmetic improvements in memory chunk header alignment coding.
- f65d21b25808 11.0 cited
-
Allow numeric to use a more compact, 2-byte header in many cases.
- 145343534c15 9.1.0 cited