Re: IndexTupleDSize macro seems redundant

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Ildar Musin <i.musin@postgrespro.ru>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2017-11-30T21:48:23Z
Lists: pgsql-hackers

Attachments

On Tue, Nov 21, 2017 at 9:26 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> +1.  I was also once confused with these macros.  I think this is a
> good cleanup.  On a quick look, I don't see any problem with your
> changes.

One difference between those two macros is that IndexTupleSize
forcibly casts the argument to IndexTuple, which means that you don't
get any type-checking when you use that one.  I suggest that in
addition to removing IndexTupleDSize as proposed, we also remove that
cast.  It seems that the only place which relies on that cast
currently is btree_xlog_split.

Therefore I propose the attached patch instead.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Commits

  1. Remove redundant IndexTupleDSize macro.