> On Sat, Jun 1, 2019 at 5:34 PM Floris Van Nee <florisvan...@optiver.com> > wrote: > > I did a little bit of investigation and it seems to occur because in > pathkeys.c the function pathkey_is_redundant considers pathkeys redundant if > there is an equality condition with a constant in the corresponding WHERE > clause. > ... > However, the index skip scan interprets this as that it has to skip over just > the first column.
Right, passing correct number of columns fixes this particular problem. But while debugging I've also discovered another related issue, when the current implementation seems to have a few assumptions, that are not correct if we have an index condition and a distinct column is not the first in the index. I'll try to address these in a next version of the patch in the nearest future.