Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET
Date
Msg-id CAA5RZ0sv0ChY8iVYbO4uLr_RLWBpEhJm7RyabJpgH3iEeP1VOg@mail.gmail.com
Whole thread Raw
In response to Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET
List pgsql-hackers
> FWIW, another idea I have on top of my mind is the addition of a
> counter in JumbleState that we increment each time we enter
> _jumbleNode(), then simply call JUMBLE_FIELD_SINGLE() after the
> incrementation.  And we can rely on this counter to be unique each
> time we jumble a node..

With this approach, the author of the custom function will need
to remember to increment the counter, right?

Also, I am wondering what is the difference between appending an incrementing
counter in JState vs just appending a constant for every node ( NULL
or NOT NULL ) ?

appending some constant or null-term to the hash:
<expression 1> <0><expression 2> <0> <0>

vs

appending an incremented value:
expression_1 <1> expression_2 <2> <3>

Both will do the job of adding the required entropy

--
Sami



pgsql-hackers by date:

Previous
From: "Euler Taveira"
Date:
Subject: Re: Separate GUC for replication origins
Next
From: "Euler Taveira"
Date:
Subject: Re: Add contrib/pg_logicalsnapinspect