On 09/30/2015 10:29 AM, Kyotaro HORIGUCHI wrote:

By the way your comment for indexrinfos is as following,

* 'indexrinfos' is a list of RestrictInfo nodes from the query's WHERE
* or JOIN conditions, excluding those implied by the index predicate
* (if the index is not partial, the list includes all restriction clauses).

But the v4 patch instead leaves it empty for non-partial
indexes:) I prefer to follow this comment because looking the
condition (index->indpred != NIL) for such purpose in
build_index_paths is somewhat uneasy for me. But I don't insist
on that if you choose to avoid useless memory and clock
consumption to construct a list which is not so meaningful for
non-partial indexes (it is almost all cases).

Good point. I think we may simply point indexrinfos to the existing list of restrictions in that case - we don't need to copy it. So no additional memory / CPU consumption, and it should make the code working with it a bit simpler.

The following comment in match_clause_to_index does not need to be a
'XXX' comment. What made you to feel to do so? (I rather feel that it
is not necessary at all.)

I agree that it may not be really necessary. I added the comment because initially I've made the check inside the for loop and then spent some time investigating why it's not working as expected.

* XXX We must do this before trying to match the index to index
*     columns, because the index predicates may use columns not
*     used in the index itself.

Anyway some description on rclauses should be added in the
comment for match_clause_to_index, instead of the comments
currently added *within* the function.

OK, will do.

kind regards

Tomas Vondra                   http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to