-
Notifications
You must be signed in to change notification settings - Fork 848
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
Improved parallel DecompressChunk worker selection #5870
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
-- Please see the included NOTICE for copyright information and | ||
-- LICENSE-APACHE for a copy of the license. | ||
|
||
SELECT * FROM compress ORDER BY time DESC, small_cardinality; | ||
SELECT * FROM compress ORDER BY time DESC, small_cardinality, large_cardinality, some_double, some_int, some_custom, some_bool; | ||
|
||
INSERT INTO compress | ||
SELECT g, 'QW', g::text, 2, 0, (100,4)::custom_type_for_compression, false | ||
|
@@ -17,7 +17,7 @@ WHERE | |
hypertable.table_name = 'compress' | ||
AND chunk.compressed_chunk_id IS NULL; | ||
|
||
SELECT * FROM compress ORDER BY time DESC, small_cardinality; | ||
SELECT * FROM compress ORDER BY time DESC, small_cardinality, large_cardinality, some_double, some_int, some_custom, some_bool; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have to use the same ordering as the existing up/downgrade tests to generate the same output. Otherwise, the tests will fail. Therefore, we need an ordering of |
||
|
||
\x on | ||
WITH hypertables AS ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1578,7 +1578,26 @@ create_compressed_scan_paths(PlannerInfo *root, RelOptInfo *compressed_rel, Comp | |
|
||
/* create parallel scan path */ | ||
if (compressed_rel->consider_parallel) | ||
ts_create_plain_partial_paths(root, compressed_rel); | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is the only caller for ts_create_plain_partial_paths we should either move the code into that function or get rid of the function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function is still called in |
||
/* Almost the same functionality as ts_create_plain_partial_paths. | ||
* | ||
* However, we also create a partial path for small chunks to allow PostgreSQL to choose a | ||
* parallel plan for decompression. If no partial path is present for a single chunk, | ||
* PostgreSQL will not use a parallel plan and all chunks are decompressed by a non-parallel | ||
* plan (even if there are a few bigger chunks). | ||
*/ | ||
int parallel_workers = compute_parallel_worker(compressed_rel, | ||
compressed_rel->pages, | ||
-1, | ||
max_parallel_workers_per_gather); | ||
|
||
/* Use at least one worker */ | ||
parallel_workers = Max(parallel_workers, 1); | ||
|
||
/* Add an unordered partial path based on a parallel sequential scan. */ | ||
add_partial_path(compressed_rel, | ||
create_seqscan_path(root, compressed_rel, NULL, parallel_workers)); | ||
} | ||
|
||
/* | ||
* We set enable_bitmapscan to false here to ensure any pathes with bitmapscan do not | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test output was not deterministic so far.