You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix segfilecount of AO/AOCO when bulk insertion: COPY
Fix#529.
For COPY FROM on AO/AOCO tables, we need to try switch
physical seg files on the fly during bulk insertion.
Else, only one insertDesc will be used and the GUC around
segfilecount does't take effect.
That's important for parallel plan.
For AO specially, bulk insertion is optimized to reuse var
block if possible, leads to additional check.
Also fix memory leak for used_segment_files which is allocated
at enter_dml_state() and shoule be preed when dml finished.
Authored-by: Zhang Mingli avamingli@gmail.com
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table.
7
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
8
+
select segfilecount from pg_appendonly where relid = 'ao_copy'::regclass;
9
+
segfilecount
10
+
--------------
11
+
0
12
+
(1 row)
13
+
14
+
set gp_appendonly_insert_files_tuples_range = 1;
15
+
-- ensure 4 files on 3 segments
16
+
COPY ao_copy from stdin;
17
+
analyze ao_copy;
18
+
select count(*) from ao_copy;
19
+
count
20
+
-------
21
+
20
22
+
(1 row)
23
+
24
+
select segfilecount from pg_appendonly where relid = 'ao_copy'::regclass;
25
+
segfilecount
26
+
--------------
27
+
4
28
+
(1 row)
29
+
30
+
reset gp_appendonly_insert_files_tuples_range;
31
+
-- aocs table
32
+
create table aocs_copy (a int) using ao_column;
33
+
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table.
34
+
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
35
+
select segfilecount from pg_appendonly where relid = 'aocs_copy'::regclass;
36
+
segfilecount
37
+
--------------
38
+
0
39
+
(1 row)
40
+
41
+
set gp_appendonly_insert_files_tuples_range = 1;
42
+
-- ensure 4 files on 3 segments
43
+
COPY aocs_copy from stdin;
44
+
analyze aocs_copy;
45
+
select count(*) from aocs_copy;
46
+
count
47
+
-------
48
+
20
49
+
(1 row)
50
+
51
+
select segfilecount from pg_appendonly where relid = 'aocs_copy'::regclass;
0 commit comments