pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feedFrom: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #3657: perf: cache composite and simple subqueries
Date: Wed, 02 Jul 2025 15:27:21 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
(on benchmarks/src/jmh/java/org/postgresql/benchmark/statement/SelectBatch.java:76)
Frankly speaking, I am afraid it is a suboptimal way of executing the queries.
The suggested SQL would have:
* 1-query statement
* 2-query statement
* 3-query statement
* ...
* 1000-query statement
That would consume n^2 memory.
The typical approach for these type of workloads is to use 2^N splits:
* 1-query statement
* 2-query statement
* 4-query statement
* 8-query statement
* 16-query statement
* 32-query statement
* 64-query statement
* 128-query statement
* 256-query statement
* 512-query statement
* 1024-query statement
Then you would have 11 queries that would be enough to cover any possible number of queries in a range of 1..2047.
For instance executing 356 would require 256+64+32+4=356.
WDYT?
view thread (16+ 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: github://pgjdbc/pgjdbc
Cc: [email protected], [email protected]
Subject: Re: [pgjdbc/pgjdbc] PR #3657: perf: cache composite and simple subqueries
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