Should we introduce a "really strict" volatility about return values? - Mailing list pgsql-hackers

From Andres Freund
Subject Should we introduce a "really strict" volatility about return values?
Date
Msg-id 20180125235155.2y6zls67w5w6ox4m@alap3.anarazel.de
Whole thread Raw
Responses Re: Should we introduce a "really strict" volatility about return values?
List pgsql-hackers
Hi,

Currently a good bit of time evaluation more complex expressions is
spent checking whether a strict [transition] function should be called
or not. There's a good number of cases where we could optimize that away
based on the underlying data - if e.g. a slot column refers to a NOT
NULL column (cf [1]), we do not need to do the NOT NULL checks.

A significant limit of that is that for even slightly morecomplex
expressions, say a + b + c that doesn't work for all the operator
invocations, because even though functions like int8pl are strict, we do
*not* guarantee that the return value is also strict.

Thus I wonder if we shouldn't introduce a 'really strict' volatility
level that signals, in addition to normal strict guarantees, that no
other case returns NULL. In a lot of cases that should allow us to
completely eliminate strictness checks from execution.

I don't plan to work on this anytime soon, but I though it's interesting
enough to put out there and see what others think.

Greetings,

Andres Freund

[1] http://archives.postgresql.org/message-id/20171206093717.vqdxe5icqttpxs3p%40alap3.anarazel.de


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Documentation of pgcrypto AES key sizes
Next
From: Stephen Frost
Date:
Subject: Re: [HACKERS] Patch: Add --no-comments to skip COMMENTs with pg_dump