Re: distribute_restrictinfo_to_rels if restrictinfo contains volatile functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: distribute_restrictinfo_to_rels if restrictinfo contains volatile functions
Date
Msg-id 2056767.1594390246@sss.pgh.pa.us
Whole thread Raw
In response to distribute_restrictinfo_to_rels if restrictinfo contains volatile functions  (Zhenghua Lyu <zlyu@vmware.com>)
Responses Re: distribute_restrictinfo_to_rels if restrictinfo contains volatile functions
List pgsql-hackers
Zhenghua Lyu <zlyu@vmware.com> writes:
>         The where clause is "pushed down to the x,y" because it only references these two relations.

Yeah.  I agree that it's somewhat unprincipled, but changing it doesn't
seem like a great idea.  There are a lot of users out there who aren't
terribly careful about marking their UDFs as non-volatile, but would be
unhappy if the optimizer suddenly crippled their queries because of
being picky about this.

Also, we specifically document that order of evaluation in WHERE clauses
is not guaranteed, so I feel no need to make promises about how often
volatile functions there will be evaluated.  (Volatiles in SELECT lists
are a different story.)

This behavior has stood for a couple of decades with few user complaints,
so why are you concerned about changing it?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Implement UNLOGGED clause for COPY FROM
Next
From: Stephen Frost
Date:
Subject: Re: Default setting for enable_hashagg_disk