Re: [HACKERS] Secondary index access optimizations - Mailing list pgsql-hackers

From Antonin Houska
Subject Re: [HACKERS] Secondary index access optimizations
Date
Msg-id 8614.1516367687@localhost
Whole thread Raw
In response to Re: [HACKERS] Secondary index access optimizations  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Responses Re: [HACKERS] Secondary index access optimizations
List pgsql-hackers
Konstantin Knizhnik <k.knizhnik@postgrespro.ru> wrote:

> On 11.01.2018 12:34, Antonin Houska wrote:

> > Konstantin Knizhnik <k.knizhnik@postgrespro.ru> wrote:

> > I haven't thought that much about details, so just one comment: you shouldn't
> > need the conversion to text and back to binary form. utils/adt/rangetypes.c
> > contains constructors that accept the binary values.
> >
> Attached please find new version of the patch which uses range type to
> interval matching in operator_predicate_proof function.

I think that instead of checking the operator name, e.g.

    strcmp(oprname, "<")

you should test the operator B-tree strategy: BTLessStrategyNumber,
BTLessEqualStrategyNumber, etc. The operator string alone does not tell enough
about the operator semantics.

The strategy can be found in the pg_amop catalog.
get_op_btree_interpretation() function may be useful, but there may be
something better in utils/cache/lsyscache.c.

--
Antonin Houska
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26, A-2700 Wiener Neustadt
Web: https://www.cybertec-postgresql.com


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)
Next
From: Simon Riggs
Date:
Subject: Re: [HACKERS] Transaction control in procedures