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.

Change History (2)

comment:2 by Paul Ramsey <pramsey@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 8b548a4/git:

Add a toast cache to index cache infrastructure, so that repeated loads of toasted-to-disk datums can avoid actually having to decompress/detoast the same object, closes #4657

Note: See TracTickets for help on using tickets.