Re: Proposal: add a debug message about using geqo
Group Key: od.order_id Batches: 1 Memory Usage: 56kB -> Hash Join (cost=37.00..72.78 rows=2040 width=12) (actual time=0.016..0.023 rows=7 loops= 1) Hash Cond: (od.product_id = p.id) -> Seq Scan on order_detail od (cost=0.00..30.40 rows=2040 width=12) (actual time=0.0 03..0.004 rows=7 loops=1) -> Hash (cost=22.00..22.00 rows=1200 width=8) (actual time=0.007..0.008 rows=4 loops= 1) Buckets: 2048 Batches: 1 Memory Usage: 17kB -> Seq Scan on product p (cost=0.00..22.00 rows=1200 width=8) (actual time=0.00 4..0.006 rows=4 loops=1) -> Hash (cost=16.30..16.30 rows=630 width=36) (actual time=0.019..0.020 rows=3 loops=1) Buckets: 1024 Batches: 1 Memory Usage: 9kB -> Seq Scan on customer c (cost=0.00..16.30 rows=630 width=36) (actual time=0.014..0.016 rows=3 loops=1) Settings: geqo_threshold = '16' GeqoDetails: GEQO: not used, geqo_threshold: 16, Max join nodes: 3 Planning Time: 0.516 ms Execution Time: 0.190 ms (24 rows) > On Tue, May 10, 2022 at 6:35 AM KAWAMOTO Masaya wrote: > > > > Hi, > > > > During query tuning, users may want to check if GEQO is used or not > > to generate a plan. However, users can not know it by simply counting > > the number of tables that appear in SQL. I know we can know it by > > enabling GEQO_DEBUG flag, but it needs recompiling, so I think it is > > inconvenient. > > > > So, I would like to propose to add a debug level message that shows > > when PostgreSQL use GEQO. That enables users to easily see it by > > just changing log_min_messages. > > > > Use cases are as follows: > > - When investigating about the result of planning, user can determine > > whether the plan is chosen by the standard planning or GEQO. > > > > - When tuning PostgreSQL, user can determine the suitable value of > > geqo_threshold parameter. > > > > Best regards. > > > > -- > > KAWAMOTO Masaya > > SRA OSS, Inc. Japan > > > > -- > Best Wishes, > Ashutosh Bapat -- KAWAMOTO Masaya SRA OSS, Inc. Japan add_geqo_info_to_explain.patch Description: Binary data
Proposal: add a debug message about using geqo
Hi, During query tuning, users may want to check if GEQO is used or not to generate a plan. However, users can not know it by simply counting the number of tables that appear in SQL. I know we can know it by enabling GEQO_DEBUG flag, but it needs recompiling, so I think it is inconvenient. So, I would like to propose to add a debug level message that shows when PostgreSQL use GEQO. That enables users to easily see it by just changing log_min_messages. Use cases are as follows: - When investigating about the result of planning, user can determine whether the plan is chosen by the standard planning or GEQO. - When tuning PostgreSQL, user can determine the suitable value of geqo_threshold parameter. Best regards. -- KAWAMOTO Masaya SRA OSS, Inc. Japan debugmessage_about_geqo.patch Description: Binary data
Re: Typo in pgbench messages.
Thanks for your comment! Sorry, I did not attach the patch file. This patch focas on master branch. Best regards, On Thu, 24 Feb 2022 12:15:55 +0900 (JST) Tatsuo Ishii wrote: > > Hi, > > > > I found messages inserted a space before the "%" in pgbench. > > I think this is typo because there are no space before the "%" in other > > messages. > > What do you think? > > I think you are right. In English there's should be no space between number > and "%". > AFAIK other parts of PostgreSQL follow the rule. > > > diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c > > index f166a77e3a..4ebe5e6ea4 100644 > > --- a/src/bin/pgbench/pgbench.c > > +++ b/src/bin/pgbench/pgbench.c > > @@ -5598,11 +5598,11 @@ printResults(StatsData *total, > > return; > > > > if (throttle_delay && latency_limit) > > - printf("number of transactions skipped: " INT64_FORMAT " (%.3f > > %%)\n", > > + printf("number of transactions skipped: " INT64_FORMAT " > > (%.3f%%)\n", > >total->skipped, 100.0 * total->skipped / total->cnt); > > > > if (latency_limit) > > - printf("number of transactions above the %.1f ms latency limit: > > " INT64_FORMAT "/" INT64_FORMAT " (%.3f %%)\n", > > + printf("number of transactions above the %.1f ms latency limit: > > " INT64_FORMAT "/" INT64_FORMAT " (%.3f%%)\n", > > latency_limit / 1000.0, latency_late, ntx, > >(ntx > 0) ? 100.0 * latency_late / ntx : 0.0); > > Looks good to me. > > Best reagards, > -- > Tatsuo Ishii > SRA OSS, Inc. Japan > English: http://www.sraoss.co.jp/index_en.php > Japanese:http://www.sraoss.co.jp > > -- KAWAMOTO Masaya SRA OSS, Inc. Japan typo_in_pgbench_messages.patch Description: Binary data
Typo in pgbench messages.
Hi, I found messages inserted a space before the "%" in pgbench. I think this is typo because there are no space before the "%" in other messages. What do you think? diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index f166a77e3a..4ebe5e6ea4 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -5598,11 +5598,11 @@ printResults(StatsData *total, return; if (throttle_delay && latency_limit) - printf("number of transactions skipped: " INT64_FORMAT " (%.3f %%)\n", + printf("number of transactions skipped: " INT64_FORMAT " (%.3f%%)\n", total->skipped, 100.0 * total->skipped / total->cnt); if (latency_limit) - printf("number of transactions above the %.1f ms latency limit: " INT64_FORMAT "/" INT64_FORMAT " (%.3f %%)\n", + printf("number of transactions above the %.1f ms latency limit: " INT64_FORMAT "/" INT64_FORMAT " (%.3f%%)\n", latency_limit / 1000.0, latency_late, ntx, (ntx > 0) ? 100.0 * latency_late / ntx : 0.0); -- KAWAMOTO Masaya SRA OSS, Inc. Japan