From 5d6f7412b10a8d391d6435051ef7b85680750f89 Mon Sep 17 00:00:00 2001 From: Ryan Krage Date: Sat, 20 Oct 2018 12:51:43 -0500 Subject: [PATCH] Improve perf on deletes when repl ident full --- wal2json.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wal2json.c b/wal2json.c index 748cc2fa014a..53a933f56379 100644 --- a/wal2json.c +++ b/wal2json.c @@ -553,6 +553,13 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu continue; } + /* Get Datum from tuple */ + origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull); + + /* Skip nulls iif printing key/identity */ + if (isnull && replident) + continue; + typid = attr->atttypid; /* Figure out type name */ @@ -563,13 +570,6 @@ tuple_to_stringinfo(LogicalDecodingContext *ctx, TupleDesc tupdesc, HeapTuple tu /* Get information needed for printing values of a type */ getTypeOutputInfo(typid, &typoutput, &typisvarlena); - /* Get Datum from tuple */ - origval = heap_getattr(tuple, natt + 1, tupdesc, &isnull); - - /* Skip nulls iif printing key/identity */ - if (isnull && replident) - continue; - /* XXX Unchanged TOAST Datum does not need to be output */ if (!isnull && typisvarlena && VARATT_IS_EXTERNAL_ONDISK(origval)) {