> On Tue, Apr 14, 2020 at 09:09:31PM +1200, David Rowley wrote:
>
> The infrastructure (knowing the unique properties of a RelOptInfo), as
> provided by the patch Andy has been working on, which is based on my
> rough prototype version, I believe should be used for the skip scans
> patch as well.
Hi,
Following our agreement about making skip scan patch to use UniqueKeys
implementation from this thread I've rebased index skip scan on first
two patches from v8 series [1] (if I understand correctly those two are
introducing the concept, and others are just using it). I would like to
clarify couple of things:
* It seems populate_baserel_uniquekeys, which actually sets uniquekeys,
is called after create_index_paths, where index skip scan already
needs to use them. Is it possible to call it earlier?
* Do I understand correctly, that a UniqueKey would be created in a
simplest case only when an index is unique? This makes it different
from what was implemented for index skip scan, since there UniqueKeys
also represents potential to use non-unique index to facilitate search
for unique values via skipping.
[1]: https://www.postgresql.org/message-id/CAKU4AWpOM3_J-B%3DwQtCeU1TGr89MhpJBBkv2he1tAeQz6i4XNw%40mail.gmail.com