Re: [HACKERS] Secondary index access optimizations

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [HACKERS] Secondary index access optimizations
Date: 2018-01-19 16:41:36
Message-ID: 083fc870-d4ab-f8df-a750-340297a9f498@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19.01.2018 16:14, Antonin Houska wrote:
> Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru> wrote:
>
>> On 11.01.2018 12:34, Antonin Houska wrote:
>>> Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)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.
>
Thank you very much.
Shame on me that I didn't notice such solution myself - such checking of
B-tree strategy is done in the same predtest.c file!
Now checking of predicate clauses compatibility is done in much more
elegant and general way.
Attached please find new version of the patch.

--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
optimizer-8.patch text/x-patch 47.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2018-01-19 16:53:45 Re: Built-in connection pooling
Previous Message Ryan Murphy 2018-01-19 16:32:34 Re: Add default role 'pg_access_server_files'