-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add vectorization for timestamp[tz] data types (#266)
- Loading branch information
Showing
5 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 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
24 changes: 24 additions & 0 deletions
24
columnar/src/test/regress/expected/columnar_vectorization.out
This file contains 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,24 @@ | ||
CREATE TABLE t (id int, ts timestamp) USING columnar; | ||
INSERT INTO t SELECT id, now() + id * '1 day'::interval FROM generate_series(1, 100000) id; | ||
EXPLAIN (costs off) SELECT * FROM t WHERE ts between '2026-01-01'::timestamp and '2026-02-01'::timestamp; | ||
QUERY PLAN | ||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
Custom Scan (ColumnarScan) on t | ||
Columnar Projected Columns: id, ts | ||
Columnar Chunk Group Filters: ((ts >= 'Thu Jan 01 00:00:00 2026'::timestamp without time zone) AND (ts <= 'Sun Feb 01 00:00:00 2026'::timestamp without time zone)) | ||
Columnar Vectorized Filter: ((ts >= 'Thu Jan 01 00:00:00 2026'::timestamp without time zone) AND (ts <= 'Sun Feb 01 00:00:00 2026'::timestamp without time zone)) | ||
(4 rows) | ||
|
||
DROP TABLE t; | ||
CREATE TABLE t (id int, ts timestamptz) USING columnar; | ||
INSERT INTO t SELECT id, now() + id * '1 day'::interval FROM generate_series(1, 100000) id; | ||
EXPLAIN (costs off) SELECT * FROM t WHERE ts between '2026-01-01'::timestamptz and '2026-02-01'::timestamptz; | ||
QUERY PLAN | ||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
Custom Scan (ColumnarScan) on t | ||
Columnar Projected Columns: id, ts | ||
Columnar Chunk Group Filters: ((ts >= 'Thu Jan 01 00:00:00 2026 PST'::timestamp with time zone) AND (ts <= 'Sun Feb 01 00:00:00 2026 PST'::timestamp with time zone)) | ||
Columnar Vectorized Filter: ((ts >= 'Thu Jan 01 00:00:00 2026 PST'::timestamp with time zone) AND (ts <= 'Sun Feb 01 00:00:00 2026 PST'::timestamp with time zone)) | ||
(4 rows) | ||
|
||
DROP TABLE t; |
This file contains 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,9 @@ | ||
CREATE TABLE t (id int, ts timestamp) USING columnar; | ||
INSERT INTO t SELECT id, now() + id * '1 day'::interval FROM generate_series(1, 100000) id; | ||
EXPLAIN (costs off) SELECT * FROM t WHERE ts between '2026-01-01'::timestamp and '2026-02-01'::timestamp; | ||
DROP TABLE t; | ||
|
||
CREATE TABLE t (id int, ts timestamptz) USING columnar; | ||
INSERT INTO t SELECT id, now() + id * '1 day'::interval FROM generate_series(1, 100000) id; | ||
EXPLAIN (costs off) SELECT * FROM t WHERE ts between '2026-01-01'::timestamptz and '2026-02-01'::timestamptz; | ||
DROP TABLE t; |