RelationGetIndexAttrBitmap() small deviation between comment and code

Started by David Rowleyabout 7 years ago3 messageshackers
Jump to latest
#1David Rowley
dgrowleyml@gmail.com

(This is pretty minor, but I struggled to ignore it)

In RelationGetIndexAttrBitmap() a comment claims /* We return our
original working copy for caller to play with */. 3 of the 4 possible
Bitmapsets follow that comment but for some reason, we make a copy of
the primary key attrs before returning. This seems both unnecessary
and also quite out of sync to what all the other Bitmapsets do. I
don't quite see any reason for doing it so I assume there's none.

The attached removes the bms_copy() and just returns the set that's
already been built in the same memory context.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

relationgetindexattrbitmap_fix.patchapplication/octet-stream; name=relationgetindexattrbitmap_fix.patchDownload+1-1
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: David Rowley (#1)
Re: RelationGetIndexAttrBitmap() small deviation between comment and code

David Rowley <david.rowley@2ndquadrant.com> writes:

(This is pretty minor, but I struggled to ignore it)
In RelationGetIndexAttrBitmap() a comment claims /* We return our
original working copy for caller to play with */. 3 of the 4 possible
Bitmapsets follow that comment but for some reason, we make a copy of
the primary key attrs before returning. This seems both unnecessary
and also quite out of sync to what all the other Bitmapsets do. I
don't quite see any reason for doing it so I assume there's none.

I agree, that's pretty bogus. Will push in a minute.

regards, tom lane

#3David Rowley
dgrowleyml@gmail.com
In reply to: Tom Lane (#2)
Re: RelationGetIndexAttrBitmap() small deviation between comment and code

On Tue, 22 Jan 2019 at 12:27, Tom Lane <tgl@sss.pgh.pa.us> wrote:

David Rowley <david.rowley@2ndquadrant.com> writes:

(This is pretty minor, but I struggled to ignore it)
In RelationGetIndexAttrBitmap() a comment claims /* We return our
original working copy for caller to play with */. 3 of the 4 possible
Bitmapsets follow that comment but for some reason, we make a copy of
the primary key attrs before returning. This seems both unnecessary
and also quite out of sync to what all the other Bitmapsets do. I
don't quite see any reason for doing it so I assume there's none.

I agree, that's pretty bogus. Will push in a minute.

Thanks.

--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services