!2375 合并pg优化,必要时增加hashjoin的bucket数量

Merge pull request !2375 from wanghao19920907/PR_2297
This commit is contained in:
opengauss-bot
2023-02-21 08:38:55 +00:00
committed by Gitee
7 changed files with 156 additions and 32 deletions

View File

@ -85,7 +85,7 @@ explain (ANALYSE on,costs off, timing off) delete from col_rep_tb2 using hash_tb
Hash Cond: (hash_tb1.b = col_rep_tb2.a)
-> Seq Scan on hash_tb1 (actual rows=5 loops=1)
-> Hash (actual rows=9 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
-> Row Adapter (actual rows=9 loops=1)
-> CStore Scan on col_rep_tb2 (actual rows=9 loops=1)
Filter: (c > 2)
@ -596,7 +596,7 @@ explain (ANALYSE on,costs off, timing off) delete from row_rep_tb using hash_tb3
Hash Cond: (hash_tb3.b = row_rep_tb.a)
-> Seq Scan on hash_tb3 (actual rows=5 loops=1)
-> Hash (actual rows=9 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
-> Seq Scan on row_rep_tb (actual rows=9 loops=1)
Filter: (c > 2)
Rows Removed by Filter: 3

View File

@ -100,7 +100,7 @@ explain (analyze on, costs off, timing off) select * from row_append_table_01 jo
Rows Removed by Join Filter: 9
-> Seq Scan on row_append_table_01 (actual rows=12 loops=1)
-> Hash (actual rows=5 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
-> Seq Scan on row_append_table_02 (actual rows=5 loops=1)
--? Total runtime: .* ms
(9 rows)

View File

@ -141,7 +141,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -162,7 +162,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -182,7 +182,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -204,7 +204,7 @@ explain analyze select aa_t1.num from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=4) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=4) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -225,7 +225,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -256,7 +256,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=31.49..31.49 rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -278,7 +278,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -326,7 +326,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: 1.476 ms
(7 rows)
@ -435,7 +435,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -456,7 +456,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -484,7 +484,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -629,7 +629,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)
@ -654,7 +654,7 @@ explain analyze select * from aa_t1, aa_t2 where aa_t1.id = aa_t2.id;
Hash Cond: (aa_t1.id = aa_t2.id)
--? -> Seq Scan on aa_t1 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? -> Hash (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
--? -> Seq Scan on aa_t2 (cost=.* rows=2149 width=8) (actual time=.* rows=2 loops=1)
--? Total runtime: .* ms
(7 rows)

View File

@ -1911,7 +1911,7 @@ execute p1(5, 6, 7, 'conflict5', 5, 5);
Filter: (c1 >= 5)
Rows Removed by Filter: 4
-> Hash (actual rows=5 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
-> HashAggregate (actual rows=5 loops=1)
Group By Key: schema_upsert_where_sublink.tab_source.c2
-> Seq Scan on tab_source (actual rows=5 loops=1)
@ -1938,7 +1938,7 @@ execute p1(5, 6, 7, 'ERROR', 4, 5);
Filter: (c1 >= 5)
Rows Removed by Filter: 4
-> Hash (actual rows=4 loops=1)
Buckets: 32768 Batches: 1 Memory Usage: 1kB
--? Buckets: 32768 Batches: 1 Memory Usage: .*kB
-> HashAggregate (actual rows=4 loops=1)
Group By Key: schema_upsert_where_sublink.tab_source.c2
-> Seq Scan on tab_source (actual rows=4 loops=1)