Hi, hackers


I'm eager to dive into how to write wal for large object. In the code path:


heap_insert -> heap_prepare_insert -> heap_toast_insert_or_update -> toast_save_datum -> heap_insert


I find heap_insert is called back.


1. At heaptup = heap_prepare_insert(relation, tup, xid, cid, options), the comment says tup is untoasted data, but it could come from toast_save_datum, still untoasted ?


2. At toast_save_datum while loop, we know heap_insert is called with every chunk data, so every chunk data is written to WAL by XLogInsert() , right ? Although it may make WAL big. (It is still the case regarding to blob, cblob ?)


3. When heap_insert is called firstly and heap_prepare_insert returns, what does heaptup mean for large object which has been chunked and written by toast_save_datum ?


Any articles about this aspect would be appreciated.