Re: tableam vs. TOAST
Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Andres Freund <andres@anarazel.de>, Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>,
Prabhat Sahu <prabhat.sahu@enterprisedb.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-11-07T10:10:19Z
Lists: pgsql-hackers
On 2019-11-06 18:00, Andres Freund wrote: > I'd like an AM to have the *option* of implementing something better, or > at least go in the direction of making that possible. I don't think the presented design prevents that. An AM can just return false from relation_needs_toast_table in all cases and implement something internally. > It seems perfectly possible to have a helper function implementing the > current logic that you just can call with the fixed chunk size as an > additional parameter. Which'd basically mean there's no meaningful > difference in complexity compared to providing the chunk size as an > external AM property. In one case you have a callback that just calls a > helper function with one parameter, in the other you fill in a member of > the struct. I can see a "moral" concern about having TOAST be part of the table AM API. It should be an implementation concern of the AM. How much more work would it be to refactor TOAST into a separate API that an AM implementation could use or not? How much more complicated would the result be? I guess you would like to at least have it explored. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
tableam: New callback relation_fetch_toast_slice.
- ce242ae154dd 13.0 landed
-
tableam: Allow choice of toast AM.
- 83322e38da1a 13.0 landed
-
Move heap-specific detoasting logic into a separate function.
- e9fd0415e6e2 13.0 landed
-
Code cleanup for toast_fetch_datum and toast_fetch_datum_slice.
- d5406dea25b6 13.0 landed
-
Rename some toasting functions based on whether they are heap-specific.
- 2e8b6bfa90b2 13.0 landed
-
Create an API for inserting and deleting rows in TOAST tables.
- bd124996ef0d 13.0 landed
-
Split tuptoaster.c into three separate files.
- 8b94dab06617 13.0 landed
-
tableam: Move heap-specific logic from needs_toast_table below tableam.
- 1171d7d58545 12.0 cited