On 27.03.2018 22:08, Simon Riggs wrote:
On 23 March 2018 at 15:54, Simon Riggs <si...@2ndquadrant.com> wrote:

So please could you make the change?
Committed, but I still think that change would be good.

Thank you.
But I still not sure whether replacement of bitmap with List or array of Oids is really good idea.

There are two aspects: size and speed. It seems to me that memory overhead is most important. At least you rejected your own idea about using autotune for this parameters because of presence of extra 16 bytes in statistic. But RelationData structure is even more space critical: its size is multiplied by number of relations and backends. Bitmap seems to provide the most compact representation of the projective index list.

Concerning speed aspect, certainly iteration through the list of all indexes with checking presence of index in the bitmap is more expensive than just direct iteration through Oid list or array. But since check of bitmap can be done in constant time, both approaches have the same complexity. Also for typical case (< 5 normal indexes for a table and 1-2 functional indexes)
difference in performance can not be measured.

Also bitmap provides convenient interface for adding new members. To construct array of Oids I need first to determine number of indexes, so I have to perform two loops.

So if you and Alvaro insist on this change, then I will definitely do it. But from my point of view, using bitmap here is acceptable solution.



--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Reply via email to