Skip to content

Commit 0dc15d4

Browse files
committed
Merge remote-tracking branch 'akuzm/compressed-bitmap' into HEAD
2 parents 74e6834 + da884dd commit 0dc15d4

File tree

3 files changed

+18
-26
lines changed

3 files changed

+18
-26
lines changed

tsl/src/nodes/decompress_chunk/decompress_chunk.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,18 +1982,6 @@ create_compressed_scan_paths(PlannerInfo *root, RelOptInfo *compressed_rel,
19821982
}
19831983
}
19841984

1985-
/*
1986-
* We set enable_bitmapscan to false here to ensure any paths with bitmapscan do not
1987-
* displace other paths. Note that setting the postgres GUC will not actually disable
1988-
* the bitmapscan path creation but will instead create them with very high cost.
1989-
* If bitmapscan were the dominant path after postgres planning we could end up
1990-
* in a situation where we have no valid plan for this relation because we remove
1991-
* bitmapscan paths from the pathlist.
1992-
*/
1993-
1994-
bool old_bitmapscan = enable_bitmapscan;
1995-
// enable_bitmapscan = false;
1996-
19971985
if (sort_info->use_compressed_sort)
19981986
{
19991987
/*
@@ -2037,8 +2025,6 @@ create_compressed_scan_paths(PlannerInfo *root, RelOptInfo *compressed_rel,
20372025
check_index_predicates(root, compressed_rel);
20382026
create_index_paths(root, compressed_rel);
20392027
}
2040-
2041-
enable_bitmapscan = old_bitmapscan;
20422028
}
20432029

20442030
/*

tsl/test/expected/hypercore.out

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,17 @@ SET enable_indexscan = false;
245245
SET timescaledb.enable_transparent_decompression TO 'hypercore';
246246
EXPLAIN (costs off, timing off, summary off)
247247
SELECT time, location, device, temp, humidity, jdata FROM :chunk WHERE device < 4 ORDER BY time, device LIMIT 5;
248-
QUERY PLAN
249-
--------------------------------------------------------------------
248+
QUERY PLAN
249+
--------------------------------------------------------------------------------------------------------------
250250
Limit
251251
-> Sort
252252
Sort Key: _hyper_1_1_chunk."time", _hyper_1_1_chunk.device
253253
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk
254-
-> Seq Scan on compress_hyper_2_32_chunk
255-
Filter: (device < 4)
256-
(6 rows)
254+
-> Bitmap Heap Scan on compress_hyper_2_32_chunk
255+
Recheck Cond: (device < 4)
256+
-> Bitmap Index Scan on compress_hyper_2_32_chunk_device__ts_meta_min_1__ts_meta_ma_idx
257+
Index Cond: (device < 4)
258+
(8 rows)
257259

258260
SELECT time, location, device, temp, humidity, jdata FROM :chunk WHERE device < 4 ORDER BY time, device LIMIT 5;
259261
time | location | device | temp | humidity | jdata

tsl/test/expected/hypercore_scans.out

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,18 +1048,22 @@ set timescaledb.enable_transparent_decompression='hypercore';
10481048
explain (costs off)
10491049
select * from readings
10501050
where time <= '2022-06-02' and device in (1, 4);
1051-
QUERY PLAN
1052-
----------------------------------------------------------------------------------------------------------------------------------------------
1051+
QUERY PLAN
1052+
--------------------------------------------------------------------------------------------------------------------------------------------------------
10531053
Append
10541054
-> Custom Scan (DecompressChunk) on _hyper_1_1_chunk
10551055
Vectorized Filter: ("time" <= 'Thu Jun 02 00:00:00 2022 PDT'::timestamp with time zone)
1056-
-> Seq Scan on compress_hyper_2_7_chunk
1057-
Filter: ((_ts_meta_min_1 <= 'Thu Jun 02 00:00:00 2022 PDT'::timestamp with time zone) AND (device = ANY ('{1,4}'::integer[])))
1056+
-> Bitmap Heap Scan on compress_hyper_2_7_chunk
1057+
Recheck Cond: ((device = ANY ('{1,4}'::integer[])) AND (_ts_meta_min_1 <= 'Thu Jun 02 00:00:00 2022 PDT'::timestamp with time zone))
1058+
-> Bitmap Index Scan on compress_hyper_2_7_chunk_device__ts_meta_min_1__ts_meta_max_idx
1059+
Index Cond: ((device = ANY ('{1,4}'::integer[])) AND (_ts_meta_min_1 <= 'Thu Jun 02 00:00:00 2022 PDT'::timestamp with time zone))
10581060
-> Custom Scan (DecompressChunk) on _hyper_1_2_chunk
10591061
Vectorized Filter: ("time" <= 'Thu Jun 02 00:00:00 2022 PDT'::timestamp with time zone)
1060-
-> Seq Scan on compress_hyper_2_8_chunk
1061-
Filter: ((_ts_meta_min_1 <= 'Thu Jun 02 00:00:00 2022 PDT'::timestamp with time zone) AND (device = ANY ('{1,4}'::integer[])))
1062-
(9 rows)
1062+
-> Bitmap Heap Scan on compress_hyper_2_8_chunk
1063+
Recheck Cond: ((device = ANY ('{1,4}'::integer[])) AND (_ts_meta_min_1 <= 'Thu Jun 02 00:00:00 2022 PDT'::timestamp with time zone))
1064+
-> Bitmap Index Scan on compress_hyper_2_8_chunk_device__ts_meta_min_1__ts_meta_max_idx
1065+
Index Cond: ((device = ANY ('{1,4}'::integer[])) AND (_ts_meta_min_1 <= 'Thu Jun 02 00:00:00 2022 PDT'::timestamp with time zone))
1066+
(13 rows)
10631067

10641068
select sum(humidity) from readings
10651069
where time <= '2022-06-02' and device in (1, 4);

0 commit comments

Comments
 (0)