Tidy fill hstv array (src/backend/access/heap/pruneheap.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Tidy fill hstv array (src/backend/access/heap/pruneheap.c)
Date
Msg-id CAEudQArhe-JXZU6O-XoiwzTS7x1xXd=0=yJh9yC1T3v6XxSYBw@mail.gmail.com
Whole thread Raw
Responses Re: Tidy fill hstv array (src/backend/access/heap/pruneheap.c)
List pgsql-hackers
Hi,

The function heap_page_prune (src/backend/access/heap/pruneheap.c)
Has a comment:

"/*
 * presult->htsv is not initialized here because all ntuple spots in the
 * array will be set either to a valid HTSV_Result value or -1.
 */

IMO, this is a little bogus and does not make sense.

I think it would be more productive to initialize the entire array with -1, and avoid flagging, one by one, the items that should be -1.

Patch attached.

best regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: Ian Lawrence Barwick
Date:
Subject: Re: doc patch: note AttributeRelationId passed to FDW validator function
Next
From: Tomas Vondra
Date:
Subject: Re: Multidimensional Histograms