Skip to content
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

Add better regression tests #77

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
results/*
regression.diffs
regression.out
*.gcno
*.o
*.so
Expand Down
70 changes: 66 additions & 4 deletions expected/simple.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
SELECT 1
?column?
----------
1
CREATE EXTENSION yezzey;
-- AO
CREATE TABLE regaoty(i INT) WITH (appendonly=true);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'i' as the Greenplum 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.
INSERT INTO regaoty SELECT * FROM generate_series(1, 100000);
SELECT * FROM yezzey_define_offload_policy('regaoty');
NOTICE: yezzey: relation virtual size calculated: 0 (seg0 slice1 127.0.1.1:6002 pid=1819226)
NOTICE: yezzey: relation virtual size calculated: 0 (seg1 slice1 127.0.1.1:6003 pid=1819227)
NOTICE: yezzey: relation virtual size calculated: 0 (seg2 slice1 127.0.1.1:6004 pid=1819228)
INFO: yezzey: relation segment reached external storage (blkno=1), up to logical eof 335168 (seg0 slice1 127.0.1.1:6002 pid=1819226)
INFO: yezzey: relation segment reached external storage (blkno=1), up to logical eof 333816 (seg1 slice1 127.0.1.1:6003 pid=1819227)
INFO: yezzey: relation segment reached external storage (blkno=1), up to logical eof 332656 (seg2 slice1 127.0.1.1:6004 pid=1819228)
yezzey_define_offload_policy
------------------------------

(1 row)

SELECT count(1) FROM yezzey_dump_virtual_index('regaoty');
count
-------
3
(1 row)

INSERT INTO regaoty SELECT * FROM generate_series(1, 100000);
SELECT count(1) FROM regaoty;
count
--------
200000
(1 row)

SELECT * FROM regaoty ORDER BY i LIMIT 5 OFFSET 7823;
i
------
3912
3913
3913
3914
3914
(5 rows)

SELECT segindex,external_bytes FROM yezzey_offload_relation_status('regaoty');
segindex | external_bytes
----------+----------------
0 | 670336
1 | 667632
2 | 665312
(3 rows)

SELECT segindex,segfileindex,external_bytes FROM yezzey_offload_relation_status_per_filesegment('regaoty');
segindex | segfileindex | external_bytes
----------+--------------+----------------
2 | 1 | 665312
1 | 1 | 667632
0 | 1 | 670336
(3 rows)

SELECT segindex,segfileindex,external_bytes FROM yezzey_relation_describe_external_storage_structure('regaoty');
segindex | segfileindex | external_bytes
----------+--------------+----------------
0 | 1 | 335168
0 | 1 | 335168
1 | 1 | 333816
1 | 1 | 333816
2 | 1 | 332656
2 | 1 | 332656
(6 rows)

22 changes: 21 additions & 1 deletion sql/simple.sql
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
SELECT 1

CREATE EXTENSION yezzey;

-- AO

CREATE TABLE regaoty(i INT) WITH (appendonly=true);
INSERT INTO regaoty SELECT * FROM generate_series(1, 100000);
SELECT * FROM yezzey_define_offload_policy('regaoty');

SELECT count(1) FROM yezzey_dump_virtual_index('regaoty');

INSERT INTO regaoty SELECT * FROM generate_series(1, 100000);

SELECT count(1) FROM regaoty;

SELECT * FROM regaoty ORDER BY i LIMIT 5 OFFSET 7823;

SELECT segindex,external_bytes FROM yezzey_offload_relation_status('regaoty');
SELECT segindex,segfileindex,external_bytes FROM yezzey_offload_relation_status_per_filesegment('regaoty');
SELECT segindex,segfileindex,external_bytes FROM yezzey_relation_describe_external_storage_structure('regaoty');

Loading