Re: [WIP] Performance Improvement by reducing WAL for Update Operation

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Amit kapila <amit(dot)kapila(at)huawei(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [WIP] Performance Improvement by reducing WAL for Update Operation
Date: 2012-08-03 20:03:00
Message-ID: 501C2E74.7060002@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 03.08.2012 14:46, Amit kapila wrote:
> Currently the change is done only for fixed length columns for simple tables and the tuple should not contain NULLS.
>
> This is a Proof of concept, the design and implementation needs to be changed based on final design required for handling other scenario's
>
> Update operation:
> -----------------------------
> 1. Check for the simple table or not.(No toast, No before update triggers)
> 2. Works only for not null tuples.
> 3. Identify the modified columns from the target entry.
> 4. Based on the modified column list, check for any variable length columns are modified, if so this optimization is not applied.
> 5. Identify the offset and length for the modified columns and store it as an optimized WAL tuple in the following format.
> Note: Wal update header is modified to denote whether wal update optimization is done or not.
> WAL update header + Tuple header(no change from previous format) +
> [offset(2bytes)] [length(2 bytes)] [changed data value]
> [offset(2bytes)] [length(2 bytes)] [changed data value]
> ....
> ....

The performance will need to be re-verified after you fix these
limitations. Those limitations need to be fixed before this can be applied.

It would be nice to use some well-known binary delta algorithm for this,
rather than invent our own. OTOH, we have more knowledge of the
attribute boundaries, so a custom algorithm might work better. In any
case, I'd like to see the code to do the delta encoding/decoding to be
put into separate functions, outside of heapam.c. It would be good for
readability, and we might want to reuse this in other places too.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2012-08-03 20:12:57 Re: [PATCH] Docs: Make notes on sequences and rollback more obvious
Previous Message Bruce Momjian 2012-08-03 20:02:28 Re: -Wformat-zero-length