-
Notifications
You must be signed in to change notification settings - Fork 202
Fix segfilecount of AO/AOCO when bulk insertion: COPY #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| create schema ao_segfile; | ||
| set search_path to ao_segfile; | ||
| set gp_appendonly_insert_files = 4; | ||
| -- ao table | ||
| create table ao_copy (a int) using ao_row; | ||
| NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. | ||
| HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. | ||
| select segfilecount from pg_appendonly where relid = 'ao_copy'::regclass; | ||
| segfilecount | ||
| -------------- | ||
| 0 | ||
| (1 row) | ||
|
|
||
| set gp_appendonly_insert_files_tuples_range = 1; | ||
| -- ensure 4 files on 3 segments | ||
| COPY ao_copy from stdin; | ||
| analyze ao_copy; | ||
| select count(*) from ao_copy; | ||
| count | ||
| ------- | ||
| 20 | ||
| (1 row) | ||
|
|
||
| select segfilecount from pg_appendonly where relid = 'ao_copy'::regclass; | ||
| segfilecount | ||
| -------------- | ||
| 4 | ||
| (1 row) | ||
|
|
||
| reset gp_appendonly_insert_files_tuples_range; | ||
| -- aocs table | ||
| create table aocs_copy (a int) using ao_column; | ||
| NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Cloudberry Database data distribution key for this table. | ||
| HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. | ||
| select segfilecount from pg_appendonly where relid = 'aocs_copy'::regclass; | ||
| segfilecount | ||
| -------------- | ||
| 0 | ||
| (1 row) | ||
|
|
||
| set gp_appendonly_insert_files_tuples_range = 1; | ||
| -- ensure 4 files on 3 segments | ||
| COPY aocs_copy from stdin; | ||
| analyze aocs_copy; | ||
| select count(*) from aocs_copy; | ||
| count | ||
| ------- | ||
| 20 | ||
| (1 row) | ||
|
|
||
| select segfilecount from pg_appendonly where relid = 'aocs_copy'::regclass; | ||
| segfilecount | ||
| -------------- | ||
| 4 | ||
| (1 row) | ||
|
|
||
| reset gp_appendonly_insert_files_tuples_range; | ||
| reset gp_appendonly_insert_files; | ||
| -- start_ignore | ||
| drop schema ao_segfile cascade; | ||
| NOTICE: drop cascades to 2 other objects | ||
| DETAIL: drop cascades to table ao_copy | ||
| drop cascades to table aocs_copy | ||
| -- end_ignore |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| create schema ao_segfile; | ||
| set search_path to ao_segfile; | ||
| set gp_appendonly_insert_files = 4; | ||
|
|
||
| -- ao table | ||
| create table ao_copy (a int) using ao_row; | ||
| select segfilecount from pg_appendonly where relid = 'ao_copy'::regclass; | ||
| set gp_appendonly_insert_files_tuples_range = 1; | ||
| -- ensure 4 files on 3 segments | ||
| COPY ao_copy from stdin; | ||
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | ||
| 7 | ||
| 8 | ||
| 9 | ||
| 10 | ||
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | ||
| 15 | ||
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | ||
| 20 | ||
| \. | ||
|
|
||
| analyze ao_copy; | ||
| select count(*) from ao_copy; | ||
| select segfilecount from pg_appendonly where relid = 'ao_copy'::regclass; | ||
| reset gp_appendonly_insert_files_tuples_range; | ||
|
|
||
| -- aocs table | ||
| create table aocs_copy (a int) using ao_column; | ||
| select segfilecount from pg_appendonly where relid = 'aocs_copy'::regclass; | ||
| set gp_appendonly_insert_files_tuples_range = 1; | ||
| -- ensure 4 files on 3 segments | ||
| COPY aocs_copy from stdin; | ||
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 | ||
| 6 | ||
| 7 | ||
| 8 | ||
| 9 | ||
| 10 | ||
| 11 | ||
| 12 | ||
| 13 | ||
| 14 | ||
| 15 | ||
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | ||
| 20 | ||
| \. | ||
|
|
||
| analyze aocs_copy; | ||
| select count(*) from aocs_copy; | ||
| select segfilecount from pg_appendonly where relid = 'aocs_copy'::regclass; | ||
| reset gp_appendonly_insert_files_tuples_range; | ||
| reset gp_appendonly_insert_files; | ||
|
|
||
| -- start_ignore | ||
| drop schema ao_segfile cascade; | ||
| -- end_ignore |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.