Some refactoring of index structures .

Поиск
Список
Период
Сортировка
Искать

Some refactoring of index structures .

От:
Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Дата:
 Hi, hackers.

Long story short, I'd like to do some refactoring of the code related to indexes.

I work on patch which provides INCLUDING columns functional [1]. The patch was reviewed again and again, I fixed many issues, but we still don't sure enough that all occurrences of rd_index->indnatts are replaced with rd_index->indnkeyatts accurately. I have no idea how to do it without thorough reading of code, so I am doing it now.

I already replaced all these
rd_index->indnatts with macro IndexRelationGetNumberOfAttributes and rd_index->indnkeyatts with macro IndexRelationGetNumberOfKeyAttributes. But still there are a lot of places with vague naming.
For example, indnatts, natts, ncolumns and so on for the very same rd_index->indnatts. I changed them with indnatts.
Or indexStruct, index, idxForm, index_form for  index->rd_index. They are definitely should be unified. I'd prefer indexForm. Any objections?

One more point is indkey in FormData_pg_index. The same for indkeys, ii_KeyAttrNumbers , indexkeys. With my patch index can have key and non-key (included) columns. Therefore indkey is not just the key now. It contains both key and included columns. And its length is not indnkeyatts as one might think, but indnatts. I suppose it's worth to rename it somehow. But I can't find the proper name. Do you have any ideas?

If you see any related changes, please, let me know.

1. http://www.postgresql.org/message-id/flat/56168952.4010101@postgrespro.ru#56168952.4010101@postgrespro.ru
-- 
Anastasia Lubennikova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
FAQ