Hi,
On Thu, Oct 1, 2026 at 2:39 PM Nisha Moond <nisha.moond412@gmail.com> wrote:
>
> Attached updated patches v5. There are a couple of optimizations and
> comment improvements in 002(testcode) too.
Thanks for the patch. It looks good to me overall, I just have coding
suggestions:
1.
Relation idxrel = index_open(idxoid, AccessShareLock);
We shall use NoLock here, since the index must have been locked already.
2.
+ for (int i = 0; i < idxrel->rd_index->indnkeyatts; i++)
+ {
+ AttrNumber attnum = idxrel->rd_index->indkey.values[i];
+
+ Assert(AttributeNumberIsValid(attnum));
+ indexbitmap = bms_add_member(indexbitmap,
+ attnum - FirstLowInvalidHeapAttributeNumber);
+ }
This Assert also looks unnecessary, removing it would make the code more
concise:
for (int i = 0; i < idxrel->rd_index->indnkeyatts; i++)
indexbitmap = bms_add_member(indexbitmap,
idxrel->rd_index->indkey.values[i] -
FirstLowInvalidHeapAttributeNumber);
The rest looks good to me.
Best Regards,
Zhijie Hou