Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> wrote:
> OK, so the reason is that when building child paths, we don't keep the > pathkeys unless it matches the "interesting" pathkeys. > > So for example we may have an IndexPath, but with pathkeys=NIL if the > index does not match the ORDER BY we need.
I don't agree that IndexPath will necessarily have pathkeys set to NIL in such a case. Even if the index ordering does not match ORDER BY clause of the query, the path can still be useful, typically for merge join.