Some refactoring of index structures .
От | Anastasia Lubennikova |
---|---|
Тема | Some refactoring of index structures . |
Дата | |
Msg-id | 56BB7788.30808@postgrespro.ru обсуждение исходный текст |
Список | pgsql-hackers |
Hi, hackers.<br /><br /> Long story short, I'd like to do some refactoring of the code related to indexes.<br /><br /> Iwork 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 <i>rd_index->indnatts</i> are replaced with <i>rd_index->indnkeyatts</i>accurately. I have no idea how to do it without <span class="b-translation__example-original"><spanclass="b-translation__text">thorough reading of code, so I am doing it now.<br/><br /> I already replaced all these </span></span><i>rd_index->indnatts </i><i></i>with macro <i>IndexRelationGetNumberOfAttributes</i>and <i>rd_index->indnkeyatts </i>with macro <i>IndexRelationGetNumberOfKeyAttributes</i>.But still there are a lot of places with vague naming.<br /> For example, <i>indnatts</i>,<i>natts</i>, <i>ncolumns</i> and so on for the very same <span class="b-translation__example-original"><spanclass="b-translation__text"></span></span><i>rd_index->indnatts. </i>I changedthem with <i>indnatts.</i><br /> Or <i>indexStruct, index, idxForm, index_form</i> for <i>index->rd_index.</i>They are definitely should be unified. I'd prefer indexForm. Any objections?<br /><br /> One morepoint is indkey in <a class="code" href="http://doxygen.postgresql.org/pg__index_8h.html#a5065be0408f03576083a30c97b43a09a">FormData_pg_index</a>.The same for<a class="code" href="http://doxygen.postgresql.org/struct__indxInfo.html#a66d6eab0efe4bcb9fcbb472d403fa981">indkeys</a>,<a class="code" href="http://doxygen.postgresql.org/structIndexInfo.html#a7723798af613a780d505231bad72c0a3">ii_KeyAttrNumbers</a>, <a class="code" href="http://doxygen.postgresql.org/structIndexOptInfo.html#ab95b0da6ff1e527506239dab1a480b82">indexkeys</a>.With my patchindex can have key and non-key (included) columns. Therefore indkey is not just the key now. It contains both key andincluded columns. And its length is not indnkeyatts as one might think, but indnatts. I suppose it's worth to rename itsomehow. But I can't find the proper name. Do you have any ideas?<br /><br /> If you see any related changes, please, letme know.<br /><br /> 1. <a href="http://www.postgresql.org/message-id/flat/56168952.4010101@postgrespro.ru#56168952.4010101@postgrespro.ru"><a class="moz-txt-link-freetext" href="http://www.postgresql.org/message-id/flat/56168952.4010101@postgrespro.ru#56168952.4010101@postgrespro.ru">http://www.postgresql.org/message-id/flat/56168952.4010101@postgrespro.ru#56168952.4010101@postgrespro.ru</a></a><br /><preclass="moz-signature" cols="72">-- Anastasia Lubennikova Postgres Professional: <a class="moz-txt-link-freetext" href="http://www.postgrespro.com">http://www.postgrespro.com</a> The Russian Postgres Company</pre>
В списке pgsql-hackers по дате отправления: