mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Reduce test variability for toast_tuple_target test
This commit is contained in:
parent
c2513365a0
commit
56f3468622
@ -1167,50 +1167,28 @@ SELECT substr(f1, 99995, 10) from toasttest;
|
|||||||
(4 rows)
|
(4 rows)
|
||||||
|
|
||||||
TRUNCATE TABLE toasttest;
|
TRUNCATE TABLE toasttest;
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
SELECT pg_relation_size('toasttest')/current_setting('block_size')::integer as blocks;
|
-- expect >0 blocks
|
||||||
|
select 0 = pg_relation_size('pg_toast.pg_toast_'||(select oid from pg_class where relname = 'toasttest'))/current_setting('block_size')::integer as blocks;
|
||||||
blocks
|
blocks
|
||||||
--------
|
--------
|
||||||
1
|
f
|
||||||
(1 row)
|
|
||||||
|
|
||||||
select pg_relation_size('pg_toast.pg_toast_'||(select oid from pg_class where relname = 'toasttest'))/current_setting('block_size')::integer as blocks;
|
|
||||||
blocks
|
|
||||||
--------
|
|
||||||
3
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT pg_total_relation_size('toasttest')/current_setting('block_size')::integer as blocks;
|
|
||||||
blocks
|
|
||||||
--------
|
|
||||||
9
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
TRUNCATE TABLE toasttest;
|
TRUNCATE TABLE toasttest;
|
||||||
ALTER TABLE toasttest set (toast_tuple_target = 4080);
|
ALTER TABLE toasttest set (toast_tuple_target = 4080);
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
SELECT pg_relation_size('toasttest')/current_setting('block_size')::integer as blocks;
|
-- expect 0 blocks
|
||||||
|
select 0 = pg_relation_size('pg_toast.pg_toast_'||(select oid from pg_class where relname = 'toasttest'))/current_setting('block_size')::integer as blocks;
|
||||||
blocks
|
blocks
|
||||||
--------
|
--------
|
||||||
2
|
t
|
||||||
(1 row)
|
|
||||||
|
|
||||||
select pg_relation_size('pg_toast.pg_toast_'||(select oid from pg_class where relname = 'toasttest'))/current_setting('block_size')::integer as blocks;
|
|
||||||
blocks
|
|
||||||
--------
|
|
||||||
0
|
|
||||||
(1 row)
|
|
||||||
|
|
||||||
SELECT pg_total_relation_size('toasttest')/current_setting('block_size')::integer as blocks;
|
|
||||||
blocks
|
|
||||||
--------
|
|
||||||
6
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
DROP TABLE toasttest;
|
DROP TABLE toasttest;
|
||||||
|
@ -367,23 +367,21 @@ SELECT substr(f1, 99995) from toasttest;
|
|||||||
SELECT substr(f1, 99995, 10) from toasttest;
|
SELECT substr(f1, 99995, 10) from toasttest;
|
||||||
|
|
||||||
TRUNCATE TABLE toasttest;
|
TRUNCATE TABLE toasttest;
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
SELECT pg_relation_size('toasttest')/current_setting('block_size')::integer as blocks;
|
-- expect >0 blocks
|
||||||
select pg_relation_size('pg_toast.pg_toast_'||(select oid from pg_class where relname = 'toasttest'))/current_setting('block_size')::integer as blocks;
|
select 0 = pg_relation_size('pg_toast.pg_toast_'||(select oid from pg_class where relname = 'toasttest'))/current_setting('block_size')::integer as blocks;
|
||||||
SELECT pg_total_relation_size('toasttest')/current_setting('block_size')::integer as blocks;
|
|
||||||
|
|
||||||
TRUNCATE TABLE toasttest;
|
TRUNCATE TABLE toasttest;
|
||||||
ALTER TABLE toasttest set (toast_tuple_target = 4080);
|
ALTER TABLE toasttest set (toast_tuple_target = 4080);
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
INSERT INTO toasttest values (repeat('1234567890',400));
|
INSERT INTO toasttest values (repeat('1234567890',300));
|
||||||
SELECT pg_relation_size('toasttest')/current_setting('block_size')::integer as blocks;
|
-- expect 0 blocks
|
||||||
select pg_relation_size('pg_toast.pg_toast_'||(select oid from pg_class where relname = 'toasttest'))/current_setting('block_size')::integer as blocks;
|
select 0 = pg_relation_size('pg_toast.pg_toast_'||(select oid from pg_class where relname = 'toasttest'))/current_setting('block_size')::integer as blocks;
|
||||||
SELECT pg_total_relation_size('toasttest')/current_setting('block_size')::integer as blocks;
|
|
||||||
|
|
||||||
DROP TABLE toasttest;
|
DROP TABLE toasttest;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user