From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | David Rowley <dgrowleyml(at)gmail(dot)com> |
Cc: | Sami Imseih <samimseih(at)gmail(dot)com>, Ivan Bykov <I(dot)Bykov(at)modernsys(dot)ru>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET |
Date: | 2025-03-21 05:45:09 |
Message-ID: | Z9z85Ui5lPkPn2hq@paquier.xyz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Mar 18, 2025 at 09:24:06PM +1300, David Rowley wrote:
> If it's for Assert enabled builds only, then to save from having to
> look at the buffer, you could have an extra field similar to
> jumble_len, but does not get reset when the jumble buffer fills. Just
> assert that the total_jumbled_bytes has grown after jumbling a node,
> maybe?
Indeed, this would work as well, and there's little point in going
full-memcmp() mode for the sake of such a check.
I have been doing some measurements to see how the NULL addition
affects the computation, and with the attached (based on what you have
sent upthread), I can see that a "SELECT 1", which would be one of the
worst cases possible based on its simple Query structure with 19 NULLs
and not much else (?), jumps from 80ms to 107~109ms for 100k loops
calling JumbleQuery(), meaning that a single computation moves from
800ns to 1070~1090ns on my local machine. So this stuff costs, which
is not surprising, but it does not seem *that* bad compared to a full
query run.
Potential ideas about optimizing the branches seem worth
investigating, I am not sure that I would be able to dig into that
until the feature freeze gong, unfortunately, and it would be nice to
fix this issue for this release. I'll see about doing some pgbench
runs on my side, as well, with tpc-b Querys.
Thoughts?
--
Michael
Attachment | Content-Type | Size |
---|---|---|
0001-Add-more-entropy-to-query-jumbling.patch | text/x-diff | 7.8 KB |
0002-Trick-to-measure-jumbling.patch.txt | text/plain | 1.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2025-03-21 05:53:12 | Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible |
Previous Message | Nisha Moond | 2025-03-21 04:50:10 | Re: Conflict detection for multiple_unique_conflicts in logical replication |