Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
32fe693
Compute compressed parallel workers based on uncompressed pages
akuzm Jan 14, 2026
336702e
benchmark parallel estimates (2026-01-14 no. 3)
akuzm Jan 14, 2026
e9411ff
Merge branch 'main' into uncompressed-parallel
akuzm Feb 13, 2026
236e962
Merge branch 'main' into uncompressed-parallel
akuzm Feb 23, 2026
004a2d7
Merge branch 'main' into uncompressed-parallel
akuzm Mar 2, 2026
5d704b8
Merge remote-tracking branch 'origin/main' into HEAD
akuzm Mar 19, 2026
52fb9bf
simpler calculations
akuzm Mar 19, 2026
5d1f6a2
benchmark parallel page estimate (2026-03-19 no. 2)
akuzm Mar 19, 2026
0deed02
reference REL_17_6 transparent_decompression
akuzm Apr 7, 2026
984ca31
reference REL_15_13 transparent_decompression
akuzm Apr 7, 2026
3ac2c8b
reference REL_16_8 transparent_decompression
akuzm Apr 7, 2026
30ede41
reference REL_18_3 transparent_decompression
akuzm Apr 7, 2026
8e2bc8a
Merge remote-tracking branch 'origin/main' into HEAD
akuzm Apr 7, 2026
693ad47
Merge remote-tracking branch 'akuzm/uncompressed-parallel' into HEAD
akuzm Apr 7, 2026
c1f8eaf
remove debug
akuzm Apr 7, 2026
4d9a138
Merge branch 'main' into uncompressed-parallel
akuzm Apr 13, 2026
71a9a0f
changelog
akuzm Apr 17, 2026
b8e7c23
Merge remote-tracking branch 'origin/main' into HEAD
akuzm Apr 17, 2026
d678dcb
Merge branch 'main' into uncompressed-parallel
akuzm Apr 28, 2026
83b0b9b
Merge branch 'main' into uncompressed-parallel
akuzm May 6, 2026
da31c10
accept the ref
akuzm May 8, 2026
9ec7f53
Merge remote-tracking branch 'origin/main' into HEAD
akuzm May 8, 2026
d8b54a4
Merge remote-tracking branch 'akuzm/uncompressed-parallel' into HEAD
akuzm May 8, 2026
8cec8fc
format
akuzm May 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion tsl/src/nodes/columnar_scan/columnar_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2422,6 +2422,28 @@ columnar_scan_path_create(PlannerInfo *root, const CompressionInfo *compression_
return path;
}

/*
* relation_byte_size, copied from costsize.c, PG 17.
* Estimate the storage space in bytes for a given number of tuples
* of a given width (size in bytes).
*/
static double
ts_relation_byte_size(double tuples, int width)
{
return tuples * (MAXALIGN(width) + MAXALIGN(SizeofHeapTupleHeader));
}

/*
* page_size, copied from costsize.c, PG 17.
* Returns an estimate of the number of pages covered by a given
* number of tuples of a given width (size in bytes).
*/
static double
ts_page_size(double tuples, int width)
{
return ceil(ts_relation_byte_size(tuples, width) / BLCKSZ);
}

/* NOTE: this needs to be called strictly after all restrictinfos have been added
* to the compressed rel
*/
Expand Down Expand Up @@ -2459,8 +2481,10 @@ create_compressed_scan_paths(PlannerInfo *root, RelOptInfo *compressed_rel,
*/
if (compressed_rel->consider_parallel && required_outer == NULL)
{
const double effective_pages = ts_page_size(compression_info->chunk_rel->tuples,
compression_info->chunk_rel->reltarget->width);
int parallel_workers = compute_parallel_worker(compressed_rel,
compressed_rel->pages,
effective_pages,
-1,
max_parallel_workers_per_gather);

Expand Down
10 changes: 5 additions & 5 deletions tsl/test/expected/transparent_decompression-15.out
Original file line number Diff line number Diff line change
Expand Up @@ -8863,7 +8863,7 @@ SET min_parallel_table_scan_size TO '0';
EXPLAIN (buffers off, costs off) SELECT * FROM metrics ORDER BY time, device_id;
--- QUERY PLAN ---
Gather Merge
Workers Planned: 3
Workers Planned: 4
-> Sort
Sort Key: metrics."time", metrics.device_id
-> Parallel Append
Expand Down Expand Up @@ -8897,16 +8897,16 @@ EXPLAIN (buffers off, costs off) SELECT * FROM metrics_space ORDER BY time, devi
-> Sort
Sort Key: metrics_space."time", metrics_space.device_id
-> Parallel Append
-> Custom Scan (ColumnarScan) on _hyper_2_5_chunk
-> Parallel Seq Scan on compress_hyper_6_18_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_11_chunk
-> Parallel Seq Scan on compress_hyper_6_21_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_4_chunk
-> Parallel Seq Scan on compress_hyper_6_17_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_6_chunk
-> Parallel Seq Scan on compress_hyper_6_19_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_10_chunk
-> Parallel Seq Scan on compress_hyper_6_20_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_5_chunk
-> Parallel Seq Scan on compress_hyper_6_18_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_11_chunk
-> Parallel Seq Scan on compress_hyper_6_21_chunk
-> Parallel Seq Scan on _hyper_2_8_chunk
-> Parallel Seq Scan on _hyper_2_7_chunk
-> Parallel Seq Scan on _hyper_2_9_chunk
Expand Down
10 changes: 5 additions & 5 deletions tsl/test/expected/transparent_decompression-16.out
Original file line number Diff line number Diff line change
Expand Up @@ -8884,7 +8884,7 @@ SET min_parallel_table_scan_size TO '0';
EXPLAIN (buffers off, costs off) SELECT * FROM metrics ORDER BY time, device_id;
--- QUERY PLAN ---
Gather Merge
Workers Planned: 3
Workers Planned: 4
-> Sort
Sort Key: metrics."time", metrics.device_id
-> Parallel Append
Expand Down Expand Up @@ -8918,16 +8918,16 @@ EXPLAIN (buffers off, costs off) SELECT * FROM metrics_space ORDER BY time, devi
-> Sort
Sort Key: metrics_space."time", metrics_space.device_id
-> Parallel Append
-> Custom Scan (ColumnarScan) on _hyper_2_5_chunk
-> Parallel Seq Scan on compress_hyper_6_18_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_11_chunk
-> Parallel Seq Scan on compress_hyper_6_21_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_4_chunk
-> Parallel Seq Scan on compress_hyper_6_17_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_6_chunk
-> Parallel Seq Scan on compress_hyper_6_19_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_10_chunk
-> Parallel Seq Scan on compress_hyper_6_20_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_5_chunk
-> Parallel Seq Scan on compress_hyper_6_18_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_11_chunk
-> Parallel Seq Scan on compress_hyper_6_21_chunk
-> Parallel Seq Scan on _hyper_2_8_chunk
-> Parallel Seq Scan on _hyper_2_7_chunk
-> Parallel Seq Scan on _hyper_2_9_chunk
Expand Down
10 changes: 5 additions & 5 deletions tsl/test/expected/transparent_decompression-17.out
Original file line number Diff line number Diff line change
Expand Up @@ -8884,7 +8884,7 @@ SET min_parallel_table_scan_size TO '0';
EXPLAIN (buffers off, costs off) SELECT * FROM metrics ORDER BY time, device_id;
--- QUERY PLAN ---
Gather Merge
Workers Planned: 3
Workers Planned: 4
-> Sort
Sort Key: metrics."time", metrics.device_id
-> Parallel Append
Expand Down Expand Up @@ -8918,16 +8918,16 @@ EXPLAIN (buffers off, costs off) SELECT * FROM metrics_space ORDER BY time, devi
-> Sort
Sort Key: metrics_space."time", metrics_space.device_id
-> Parallel Append
-> Custom Scan (ColumnarScan) on _hyper_2_5_chunk
-> Parallel Seq Scan on compress_hyper_6_18_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_11_chunk
-> Parallel Seq Scan on compress_hyper_6_21_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_4_chunk
-> Parallel Seq Scan on compress_hyper_6_17_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_6_chunk
-> Parallel Seq Scan on compress_hyper_6_19_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_10_chunk
-> Parallel Seq Scan on compress_hyper_6_20_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_5_chunk
-> Parallel Seq Scan on compress_hyper_6_18_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_11_chunk
-> Parallel Seq Scan on compress_hyper_6_21_chunk
-> Parallel Seq Scan on _hyper_2_8_chunk
-> Parallel Seq Scan on _hyper_2_7_chunk
-> Parallel Seq Scan on _hyper_2_9_chunk
Expand Down
10 changes: 5 additions & 5 deletions tsl/test/expected/transparent_decompression-18.out
Original file line number Diff line number Diff line change
Expand Up @@ -8971,7 +8971,7 @@ SET min_parallel_table_scan_size TO '0';
EXPLAIN (buffers off, costs off) SELECT * FROM metrics ORDER BY time, device_id;
--- QUERY PLAN ---
Gather Merge
Workers Planned: 3
Workers Planned: 4
-> Sort
Sort Key: metrics."time", metrics.device_id
-> Parallel Append
Expand Down Expand Up @@ -9005,16 +9005,16 @@ EXPLAIN (buffers off, costs off) SELECT * FROM metrics_space ORDER BY time, devi
-> Sort
Sort Key: metrics_space."time", metrics_space.device_id
-> Parallel Append
-> Custom Scan (ColumnarScan) on _hyper_2_5_chunk
-> Parallel Seq Scan on compress_hyper_6_18_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_11_chunk
-> Parallel Seq Scan on compress_hyper_6_21_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_4_chunk
-> Parallel Seq Scan on compress_hyper_6_17_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_6_chunk
-> Parallel Seq Scan on compress_hyper_6_19_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_10_chunk
-> Parallel Seq Scan on compress_hyper_6_20_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_5_chunk
-> Parallel Seq Scan on compress_hyper_6_18_chunk
-> Custom Scan (ColumnarScan) on _hyper_2_11_chunk
-> Parallel Seq Scan on compress_hyper_6_21_chunk
-> Parallel Seq Scan on _hyper_2_8_chunk
-> Parallel Seq Scan on _hyper_2_7_chunk
-> Parallel Seq Scan on _hyper_2_9_chunk
Expand Down
Loading