From: | ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker ) |
---|---|
To: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
Cc: | Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: pgbench MAX_ARGS |
Date: | 2019-02-26 14:02:39 |
Message-ID: | d8jo96y8x6o.fsf@dalvik.ping.uio.no |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> diff --git a/src/bin/pgbench/t/001_pgbench_with_server.pl b/src/bin/pgbench/t/001_pgbench_with_server.pl
> index ad15ba66ea..2e4957c09a 100644
> --- a/src/bin/pgbench/t/001_pgbench_with_server.pl
> +++ b/src/bin/pgbench/t/001_pgbench_with_server.pl
> @@ -587,10 +587,19 @@ my @errors = (
> }
> ],
> [
> - 'sql too many args', 1, [qr{statement has too many arguments.*\b9\b}],
> - q{-- MAX_ARGS=10 for prepared
> + 'sql too many args', 1, [qr{statement has too many arguments.*\b256\b}],
> + q{-- MAX_ARGS=256 for prepared
> \set i 0
> -SELECT LEAST(:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i);
> +SELECT LEAST(
> +:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i,
> +:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i,
> +:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i,
> +:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i,
> +:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i,
> +:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i,
> +:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i,
> +:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i,
> +:i);
> }
> ],
Instead of that wall of :i's, would it not be clearer to use the
repetition operator?
[
- 'sql too many args', 1, [qr{statement has too many arguments.*\b9\b}],
- q{-- MAX_ARGS=10 for prepared
+ 'sql too many args', 1, [qr{statement has too many arguments.*\b256\b}],
+ q{-- MAX_ARGS=256 for prepared
\set i 0
-SELECT LEAST(:i, :i, :i, :i, :i, :i, :i, :i, :i, :i, :i);
+SELECT LEAST(}.join(', ', (':i') x 257).q{);
}
],
- ilmari
--
"A disappointingly low fraction of the human race is,
at any given time, on fire." - Stig Sandbeck Mathisen
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Finnerty | 2019-02-26 14:07:42 | Re: NOT IN subquery optimization |
Previous Message | Alexey Kondratov | 2019-02-26 13:17:11 | Probably misleading comments or lack of tests in autoHeld portals management |