On Mon, Dec 31, 2018 at 9:56 AM Amit Kapila <amit.kapil...@gmail.com> wrote: > > To support logical decoding for zheap operations, we need a way to > ensure zheap tuples can be registered as change streams. One idea > could be that we make ReorderBufferChange aware of another kind of > tuples as well, something like this: > .. > > Apart from this, we need to define different decode functions for > zheap operations as the WAL data is different for heap and zheap, so > same functions can't be used to decode. > > I have written a very hacky version to support zheap Insert operation > based on the above idea. >
I went ahead and tried to implement the decoding for Delete operation as well based on the above approach and the result is attached. > > The yet another approach could be that in the decode functions after > forming zheap tuples from WAL, we can convert them to heap tuples. I > have not tried that, so not sure if it can work, but it seems to me if > we can avoid tuple conversion overhead, it will be good. > While implementing the decoding for delete operation, I noticed that the main changes required are to write a decode operation and additional WAL (like old tuple) which anyway is required even if we pursue this approach, so I think it might be better to with the approach where we don't need tuple conversion (aka something similar to what is done in attached patch). Note - This patch is based on pluggable-zheap branch (https://github.com/anarazel/postgres-pluggable-storage) -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
decode_zops_2.patch
Description: Binary data