Opened 5 years ago
Closed 5 years ago
#4657 closed enhancement (fixed)
Avoid De-TOASTing where Possible
Reported by: | pramsey | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 3.1.0 |
Component: | postgis | Version: | master |
Keywords: | Cc: |
Description
In answer to a query about using Datum as a key in a cache to avoid de-TOASTING overhead, Tom Lane said:
https://www.postgresql.org/message-id/8196.1585870220@sss.pgh.pa.us
The case where this would actually be worth doing, probably, is where you are receiving a toasted-out-of-line datum. In that case you could legitimately use the toast pointer ID values (va_valueid + va_toastrelid) as a lookup key for a cache, as long as it had a lifespan of a statement or less.
This actually turns out to be a small extra patch that just sits at the detoast step at the top of functions that use caching machinery.
https://github.com/postgis/postgis/pull/552