Re: tuplesort.c's copytup_index() is dead code - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: tuplesort.c's copytup_index() is dead code
Date
Msg-id CAM3SWZR9HcXoZ9jfkn4oGppBhrWedDeoHjAAw0TVAtC0RJ6=Yw@mail.gmail.com
Whole thread Raw
In response to Re: tuplesort.c's copytup_index() is dead code  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: tuplesort.c's copytup_index() is dead code  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Fri, Jun 24, 2016 at 2:18 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Uh, why?  It's not a large amount of code and it seems like removing
> it puts a fair-size hole in the symmetry of tuplesort's capabilities.

It's not a small amount of code either.

Removing the code clarifies the division of labor between COPYTUP()
routines in general, their callers (tuplesort_putheaptuple() and
tuplesort_puttupleslot() -- which are also puttuple_common() callers),
and routines that are similar to those caller routines (in that they
at least call puttuple_common()) that do not call COPYTUP()
(tuplesort_putdatum(), and now tuplesort_putindextuplevalues()).

I believe that this has value. All the extra boilerplate code misleads.

-- 
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: tuplesort.c's copytup_index() is dead code
Next
From: Gavin Flower
Date:
Subject: Re: Bug in to_timestamp().