agora inbox for [email protected]
help / color / mirror / Atom feedFrom: Konstantin Knizhnik <[email protected]>
To: Peter Eisentraut <[email protected]>
To: PostgreSQL Hackers <[email protected]>
Subject: Re: Surjective functional indexes
Date: Mon, 29 May 2017 09:20:00 +0300
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-hackers>
On 05/27/2017 09:50 PM, Peter Eisentraut wrote:
> On 5/25/17 12:30, Konstantin Knizhnik wrote:
>> Functions like (info->>'name') are named "surjective" ni mathematics.
> A surjective function is one where each value in the output type can be
> obtained by some input value. That's not what you are after here. The
> behavior you are describing is a not-injective function.
>
> I think you are right that in practice most functions are not injective.
> But I think there is still quite some difference between a function
> like the one you showed that selects a component from a composite data
> structure and, for example, round(), where in practice any update is
> likely to change the result of the function.
>
Thank you, I will rename "surjective" parameter to "injective" with "false" as default value.
Concerning "round" and other similar functions - obviously there are use cases when such functions are used for
functional indexes. This is why I want to allow user to make a choice and this is the reason of introducing this parameter.
The question is the default value of this parameter: should we by default preserve original Postgres behavior:
check only affected set of keys or should we pay extra cost for calculating value of the function (even if we managed to store
calculated value of the indexes expression for new tuple, we still have to calculate it for old tuple, so function will be calculated
at least twice more times).
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
view thread (36+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: Surjective functional indexes
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox