Skip to content

Commit d2e988b

Browse files
HBKOpolardb-bot[bot]
authored andcommitted
[Feature] fix some performance guc default
1 parent 95aeb5b commit d2e988b

File tree

8 files changed

+172
-203
lines changed

8 files changed

+172
-203
lines changed

src/backend/utils/misc/guc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5845,7 +5845,7 @@ static struct config_int ConfigureNamesInt[] =
58455845
GUC_UNIT_BLOCKS
58465846
},
58475847
&polar_bulk_extend_size,
5848-
0, 0, INT_MAX / 2,
5848+
512, 0, INT_MAX / 2,
58495849
NULL, NULL, NULL
58505850
},
58515851
{

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,8 @@
475475
# %% = '%'
476476
# e.g. '<%u%%%d> '
477477
#log_lock_waits = off # log lock waits >= deadlock_timeout
478-
#log_statement = 'none' # none, ddl, mod, all
478+
log_statement = 'ddl' # none, ddl, mod, all
479+
479480
#log_replication_commands = off
480481
#log_temp_files = -1 # log temporary files equal or larger
481482
# than the specified size in kilobytes;

src/backend/utils/misc/postgresql.conf.sample.polardb_pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ log_planner_stats=off
108108
log_replication_commands=off
109109
log_rotation_age=0
110110
log_rotation_size=131072 #128MB
111-
log_statement='all'
111+
log_statement='ddl'
112112
log_statement_stats=off
113113
log_temp_files=100000
114114
log_timezone='UTC'

src/test/regress/expected/polar-dev/polar_index_bulk_extend_for_coverage.out

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
-- the regression test cases don't create an big table.
55
ALTER SYSTEM SET polar_index_bulk_extend_size = 512;
66
ALTER SYSTEM SET polar_min_bulk_extend_table_size = 0;
7+
ALTER SYSTEM SET polar_bulk_extend_size = 0;
78
SELECT pg_reload_conf();
89
pg_reload_conf
910
----------------
@@ -39,8 +40,9 @@ SELECT * FROM test_index_bulk_extend LIMIT 1;
3940

4041
DROP INDEX test_index_bulk;
4142
DROP TABLE test_index_bulk_extend;
42-
RESET polar_index_bulk_extend_size;
43-
RESET polar_min_bulk_extend_table_size;
43+
ALTER SYSTEM RESET polar_index_bulk_extend_size;
44+
ALTER SYSTEM RESET polar_min_bulk_extend_table_size;
45+
ALTER SYSTEM RESET polar_bulk_extend_size;
4446
SELECT pg_reload_conf();
4547
pg_reload_conf
4648
----------------

src/test/regress/px_expected/polar-px-dev/dynamic_partition_pruning_hash.out

Lines changed: 63 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -405,36 +405,24 @@ select * from t, pt where tid = ptid and t1 = 'hello' || tid;
405405
(33 rows)
406406

407407
explain (costs off, timing off, summary off) select * from t, pt where t1 = pt1 and ptid = tid;
408-
QUERY PLAN
409-
---------------------------------------------------------------
410-
Nested Loop
411-
-> Seq Scan on t
412-
-> Append
413-
-> Seq Scan on pt_p0
414-
Filter: ((t.t1 = pt1) AND (t.tid = ptid))
415-
-> Seq Scan on pt_p1
416-
Filter: ((t.t1 = pt1) AND (t.tid = ptid))
417-
-> Bitmap Heap Scan on pt_p2
418-
Recheck Cond: ((ptid = t.tid) AND (pt1 = t.t1))
419-
-> BitmapAnd
420-
-> Bitmap Index Scan on pt_p2_ptid_idx
421-
Index Cond: (ptid = t.tid)
422-
-> Bitmap Index Scan on pt_p2_pt1_idx
423-
Index Cond: (pt1 = t.t1)
424-
-> Bitmap Heap Scan on pt_p3
425-
Recheck Cond: ((ptid = t.tid) AND (pt1 = t.t1))
426-
-> BitmapAnd
427-
-> Bitmap Index Scan on pt_p3_ptid_idx
428-
Index Cond: (ptid = t.tid)
429-
-> Bitmap Index Scan on pt_p3_pt1_idx
430-
Index Cond: (pt1 = t.t1)
431-
-> Seq Scan on pt_p4
432-
Filter: ((t.t1 = pt1) AND (t.tid = ptid))
433-
-> Seq Scan on pt_p5
434-
Filter: ((t.t1 = pt1) AND (t.tid = ptid))
435-
-> Seq Scan on pt_p6
436-
Filter: ((t.t1 = pt1) AND (t.tid = ptid))
437-
(27 rows)
408+
QUERY PLAN
409+
-----------------------------------------------------
410+
Merge Join
411+
Merge Cond: (pt_p0.pt1 = t.t1)
412+
Join Filter: (t.tid = pt_p0.ptid)
413+
-> Merge Append
414+
Sort Key: pt_p0.pt1
415+
-> Index Scan using pt_p0_pt1_idx on pt_p0
416+
-> Index Scan using pt_p1_pt1_idx on pt_p1
417+
-> Index Scan using pt_p2_pt1_idx on pt_p2
418+
-> Index Scan using pt_p3_pt1_idx on pt_p3
419+
-> Index Scan using pt_p4_pt1_idx on pt_p4
420+
-> Index Scan using pt_p5_pt1_idx on pt_p5
421+
-> Index Scan using pt_p6_pt1_idx on pt_p6
422+
-> Sort
423+
Sort Key: t.t1
424+
-> Seq Scan on t
425+
(15 rows)
438426

439427
select * from t, pt where t1 = pt1 and ptid = tid;
440428
dist | tid | t1 | t2 | dist | pt1 | pt2 | pt3 | ptid
@@ -1812,30 +1800,23 @@ set polar_px_optimizer_enable_seqscan=on;
18121800
set polar_px_optimizer_enable_hashjoin=on;
18131801
set polar_px_optimizer_enable_nestloopjoin=off;
18141802
explain (costs off, timing off, summary off) select * from t, pt where t1 = pt1;
1815-
QUERY PLAN
1816-
------------------------------------------------------
1817-
Nested Loop
1818-
-> Seq Scan on t
1819-
-> Append
1820-
-> Seq Scan on pt_p0
1821-
Filter: (t.t1 = pt1)
1822-
-> Seq Scan on pt_p1
1823-
Filter: (t.t1 = pt1)
1824-
-> Bitmap Heap Scan on pt_p2
1825-
Recheck Cond: (pt1 = t.t1)
1826-
-> Bitmap Index Scan on pt_p2_pt1_idx
1827-
Index Cond: (pt1 = t.t1)
1828-
-> Bitmap Heap Scan on pt_p3
1829-
Recheck Cond: (pt1 = t.t1)
1830-
-> Bitmap Index Scan on pt_p3_pt1_idx
1831-
Index Cond: (pt1 = t.t1)
1832-
-> Seq Scan on pt_p4
1833-
Filter: (t.t1 = pt1)
1834-
-> Seq Scan on pt_p5
1835-
Filter: (t.t1 = pt1)
1836-
-> Seq Scan on pt_p6
1837-
Filter: (t.t1 = pt1)
1838-
(21 rows)
1803+
QUERY PLAN
1804+
-----------------------------------------------------
1805+
Merge Join
1806+
Merge Cond: (pt_p0.pt1 = t.t1)
1807+
-> Merge Append
1808+
Sort Key: pt_p0.pt1
1809+
-> Index Scan using pt_p0_pt1_idx on pt_p0
1810+
-> Index Scan using pt_p1_pt1_idx on pt_p1
1811+
-> Index Scan using pt_p2_pt1_idx on pt_p2
1812+
-> Index Scan using pt_p3_pt1_idx on pt_p3
1813+
-> Index Scan using pt_p4_pt1_idx on pt_p4
1814+
-> Index Scan using pt_p5_pt1_idx on pt_p5
1815+
-> Index Scan using pt_p6_pt1_idx on pt_p6
1816+
-> Sort
1817+
Sort Key: t.t1
1818+
-> Seq Scan on t
1819+
(14 rows)
18391820

18401821
select * from t, pt where t1 = pt1;
18411822
dist | tid | t1 | t2 | dist | pt1 | pt2 | pt3 | ptid
@@ -2244,38 +2225,41 @@ insert into t1 select i, -100, 'dummy' from generate_series(1,10) i;
22442225
analyze t;
22452226
analyze t1;
22462227
explain (costs off, timing off, summary off) select * from t, t1, pt where t1.tid = ptid and t.tid = ptid;
2247-
QUERY PLAN
2248-
-----------------------------------------
2249-
Hash Join
2250-
Hash Cond: (pt_p0.ptid = t1.tid)
2251-
-> Hash Join
2252-
Hash Cond: (pt_p0.ptid = t.tid)
2253-
-> Append
2254-
-> Seq Scan on pt_p0
2255-
-> Seq Scan on pt_p1
2256-
-> Seq Scan on pt_p2
2257-
-> Seq Scan on pt_p3
2258-
-> Seq Scan on pt_p4
2259-
-> Seq Scan on pt_p5
2260-
-> Seq Scan on pt_p6
2261-
-> Hash
2228+
QUERY PLAN
2229+
------------------------------------------------------------
2230+
Merge Join
2231+
Merge Cond: (pt_p0.ptid = t1.tid)
2232+
-> Merge Join
2233+
Merge Cond: (pt_p0.ptid = t.tid)
2234+
-> Merge Append
2235+
Sort Key: pt_p0.ptid
2236+
-> Index Scan using pt_p0_ptid_idx on pt_p0
2237+
-> Index Scan using pt_p1_ptid_idx on pt_p1
2238+
-> Index Scan using pt_p2_ptid_idx on pt_p2
2239+
-> Index Scan using pt_p3_ptid_idx on pt_p3
2240+
-> Index Scan using pt_p4_ptid_idx on pt_p4
2241+
-> Index Scan using pt_p5_ptid_idx on pt_p5
2242+
-> Index Scan using pt_p6_ptid_idx on pt_p6
2243+
-> Sort
2244+
Sort Key: t.tid
22622245
-> Seq Scan on t
2263-
-> Hash
2246+
-> Sort
2247+
Sort Key: t1.tid
22642248
-> Seq Scan on t1
2265-
(16 rows)
2249+
(19 rows)
22662250

22672251
select * from t, t1, pt where t1.tid = ptid and t.tid = ptid;
22682252
dist | tid | t1 | t2 | dist | tid | t1 | t2 | dist | pt1 | pt2 | pt3 | ptid
22692253
------+-----+--------+-----+------+-----+--------+-----+------+---------+-------+-----------+------
2270-
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 1 | hello1 | world | drop this | 1
2271-
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 7 | hello7 | world | drop this | 1
2272-
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 13 | hello13 | world | drop this | 1
2273-
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 19 | hello19 | world | drop this | 1
2274-
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 25 | hello25 | world | drop this | 1
2275-
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 31 | hello31 | world | drop this | 1
2276-
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 37 | hello37 | world | drop this | 1
2277-
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 43 | hello43 | world | drop this | 1
22782254
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 49 | hello49 | world | drop this | 1
2255+
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 43 | hello43 | world | drop this | 1
2256+
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 37 | hello37 | world | drop this | 1
2257+
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 31 | hello31 | world | drop this | 1
2258+
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 25 | hello25 | world | drop this | 1
2259+
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 19 | hello19 | world | drop this | 1
2260+
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 13 | hello13 | world | drop this | 1
2261+
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 7 | hello7 | world | drop this | 1
2262+
1 | 1 | hello1 | bar | 1 | 1 | hello1 | bar | 1 | hello1 | world | drop this | 1
22792263
(9 rows)
22802264

22812265
rollback;

src/test/regress/px_expected/polar-px-dev/dynamic_partition_pruning_range.out

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -364,20 +364,23 @@ select * from t, pt where tid = ptid and t1 = 'hello' || tid;
364364
(30 rows)
365365

366366
explain (costs off, timing off, summary off) select * from t, pt where t1 = pt1 and ptid = tid;
367-
QUERY PLAN
368-
------------------------------------------------------------
369-
Hash Join
370-
Hash Cond: ((pt_p1.pt1 = t.t1) AND (pt_p1.ptid = t.tid))
371-
-> Append
372-
-> Seq Scan on pt_p1
373-
-> Seq Scan on pt_p2
374-
-> Seq Scan on pt_p3
375-
-> Seq Scan on pt_p4
376-
-> Seq Scan on pt_p5
377-
-> Seq Scan on pt_junk_data
378-
-> Hash
367+
QUERY PLAN
368+
-------------------------------------------------------------------
369+
Merge Join
370+
Merge Cond: (pt_p1.pt1 = t.t1)
371+
Join Filter: (t.tid = pt_p1.ptid)
372+
-> Merge Append
373+
Sort Key: pt_p1.pt1
374+
-> Index Scan using pt_p1_pt1_idx on pt_p1
375+
-> Index Scan using pt_p2_pt1_idx on pt_p2
376+
-> Index Scan using pt_p3_pt1_idx on pt_p3
377+
-> Index Scan using pt_p4_pt1_idx on pt_p4
378+
-> Index Scan using pt_p5_pt1_idx on pt_p5
379+
-> Index Scan using pt_junk_data_pt1_idx on pt_junk_data
380+
-> Sort
381+
Sort Key: t.t1
379382
-> Seq Scan on t
380-
(11 rows)
383+
(14 rows)
381384

382385
select * from t, pt where t1 = pt1 and ptid = tid;
383386
dist | tid | t1 | t2 | dist | pt1 | pt2 | pt3 | ptid
@@ -1627,20 +1630,22 @@ set polar_px_optimizer_enable_seqscan=on;
16271630
set polar_px_optimizer_enable_hashjoin=on;
16281631
set polar_px_optimizer_enable_nestloopjoin=off;
16291632
explain (costs off, timing off, summary off) select * from t, pt where t1 = pt1;
1630-
QUERY PLAN
1631-
--------------------------------------
1632-
Hash Join
1633-
Hash Cond: (pt_p1.pt1 = t.t1)
1634-
-> Append
1635-
-> Seq Scan on pt_p1
1636-
-> Seq Scan on pt_p2
1637-
-> Seq Scan on pt_p3
1638-
-> Seq Scan on pt_p4
1639-
-> Seq Scan on pt_p5
1640-
-> Seq Scan on pt_junk_data
1641-
-> Hash
1633+
QUERY PLAN
1634+
-------------------------------------------------------------------
1635+
Merge Join
1636+
Merge Cond: (pt_p1.pt1 = t.t1)
1637+
-> Merge Append
1638+
Sort Key: pt_p1.pt1
1639+
-> Index Scan using pt_p1_pt1_idx on pt_p1
1640+
-> Index Scan using pt_p2_pt1_idx on pt_p2
1641+
-> Index Scan using pt_p3_pt1_idx on pt_p3
1642+
-> Index Scan using pt_p4_pt1_idx on pt_p4
1643+
-> Index Scan using pt_p5_pt1_idx on pt_p5
1644+
-> Index Scan using pt_junk_data_pt1_idx on pt_junk_data
1645+
-> Sort
1646+
Sort Key: t.t1
16421647
-> Seq Scan on t
1643-
(11 rows)
1648+
(13 rows)
16441649

16451650
select * from t, pt where t1 = pt1;
16461651
dist | tid | t1 | t2 | dist | pt1 | pt2 | pt3 | ptid

0 commit comments

Comments
 (0)