diff options
| author | Amit Kapila | 2019-01-28 06:01:44 +0000 |
|---|---|---|
| committer | Amit Kapila | 2019-01-28 06:01:44 +0000 |
| commit | a23676503b746b7f1588cd2ab0c60411032d32da (patch) | |
| tree | ac7f172ec94771441558639e0725e6d56d6e7b47 /src/test | |
| parent | ac88d2962a96a9c7e83d5acfc28fe49a72812086 (diff) | |
Revert "Avoid creation of the free space map for small heap relations."
This reverts commit ac88d2962a96a9c7e83d5acfc28fe49a72812086.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/regress/expected/fsm.out | 75 | ||||
| -rw-r--r-- | src/test/regress/parallel_schedule | 6 | ||||
| -rw-r--r-- | src/test/regress/serial_schedule | 1 | ||||
| -rw-r--r-- | src/test/regress/sql/fsm.sql | 55 |
4 files changed, 0 insertions, 137 deletions
diff --git a/src/test/regress/expected/fsm.out b/src/test/regress/expected/fsm.out deleted file mode 100644 index df6b15b9d2a..00000000000 --- a/src/test/regress/expected/fsm.out +++ /dev/null @@ -1,75 +0,0 @@ --- --- Free Space Map test --- -CREATE TABLE fsm_check_size (num int, str text); --- Fill 3 blocks with as many large records as will fit --- No FSM -INSERT INTO fsm_check_size SELECT i, rpad('', 1024, 'a') -FROM generate_series(1,7*3) i; -VACUUM fsm_check_size; -SELECT pg_relation_size('fsm_check_size', 'main') AS heap_size, -pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - heap_size | fsm_size ------------+---------- - 24576 | 0 -(1 row) - --- Clear some space on block 0 -DELETE FROM fsm_check_size WHERE num <= 5; -VACUUM fsm_check_size; --- Insert small record in block 2 to set the cached smgr targetBlock -INSERT INTO fsm_check_size VALUES(99, 'b'); --- Insert large record and make sure it goes in block 0 rather than --- causing the relation to extend -INSERT INTO fsm_check_size VALUES (101, rpad('', 1024, 'a')); -SELECT pg_relation_size('fsm_check_size', 'main') AS heap_size, -pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - heap_size | fsm_size ------------+---------- - 24576 | 0 -(1 row) - --- Extend table with enough blocks to exceed the FSM threshold --- FSM is created and extended to 3 blocks -INSERT INTO fsm_check_size SELECT i, 'c' FROM generate_series(200,1200) i; -VACUUM fsm_check_size; -SELECT pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - fsm_size ----------- - 24576 -(1 row) - --- Truncate heap to 1 block --- No change in FSM -DELETE FROM fsm_check_size WHERE num > 7; -VACUUM fsm_check_size; -SELECT pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - fsm_size ----------- - 24576 -(1 row) - --- Truncate heap to 0 blocks --- FSM now truncated to 2 blocks -DELETE FROM fsm_check_size; -VACUUM fsm_check_size; -SELECT pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - fsm_size ----------- - 16384 -(1 row) - --- Add long random string to extend TOAST table to 1 block -INSERT INTO fsm_check_size -VALUES(0, (SELECT string_agg(md5(chr(i)), '') - FROM generate_series(1,100) i)); -VACUUM fsm_check_size; -SELECT pg_relation_size(reltoastrelid, 'main') AS toast_size, -pg_relation_size(reltoastrelid, 'fsm') AS toast_fsm_size -FROM pg_class WHERE relname = 'fsm_check_size'; - toast_size | toast_fsm_size -------------+---------------- - 8192 | 0 -(1 row) - -DROP TABLE fsm_check_size; diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index 4051a4ad4e1..cc0bbf5db9f 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -69,12 +69,6 @@ test: create_aggregate create_function_3 create_cast constraints triggers inheri test: sanity_check # ---------- -# fsm does a delete followed by vacuum, and running it in parallel can prevent -# removal of rows. -# ---------- -test: fsm - -# ---------- # Believe it or not, select creates a table, subsequent # tests need. # ---------- diff --git a/src/test/regress/serial_schedule b/src/test/regress/serial_schedule index ac1ea622d65..0c10c7100c6 100644 --- a/src/test/regress/serial_schedule +++ b/src/test/regress/serial_schedule @@ -80,7 +80,6 @@ test: roleattributes test: create_am test: hash_func test: sanity_check -test: fsm test: errors test: select test: select_into diff --git a/src/test/regress/sql/fsm.sql b/src/test/regress/sql/fsm.sql deleted file mode 100644 index 07f505591a8..00000000000 --- a/src/test/regress/sql/fsm.sql +++ /dev/null @@ -1,55 +0,0 @@ --- --- Free Space Map test --- - -CREATE TABLE fsm_check_size (num int, str text); - --- Fill 3 blocks with as many large records as will fit --- No FSM -INSERT INTO fsm_check_size SELECT i, rpad('', 1024, 'a') -FROM generate_series(1,7*3) i; -VACUUM fsm_check_size; -SELECT pg_relation_size('fsm_check_size', 'main') AS heap_size, -pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - --- Clear some space on block 0 -DELETE FROM fsm_check_size WHERE num <= 5; -VACUUM fsm_check_size; - --- Insert small record in block 2 to set the cached smgr targetBlock -INSERT INTO fsm_check_size VALUES(99, 'b'); - --- Insert large record and make sure it goes in block 0 rather than --- causing the relation to extend -INSERT INTO fsm_check_size VALUES (101, rpad('', 1024, 'a')); -SELECT pg_relation_size('fsm_check_size', 'main') AS heap_size, -pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - --- Extend table with enough blocks to exceed the FSM threshold --- FSM is created and extended to 3 blocks -INSERT INTO fsm_check_size SELECT i, 'c' FROM generate_series(200,1200) i; -VACUUM fsm_check_size; -SELECT pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - --- Truncate heap to 1 block --- No change in FSM -DELETE FROM fsm_check_size WHERE num > 7; -VACUUM fsm_check_size; -SELECT pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - --- Truncate heap to 0 blocks --- FSM now truncated to 2 blocks -DELETE FROM fsm_check_size; -VACUUM fsm_check_size; -SELECT pg_relation_size('fsm_check_size', 'fsm') AS fsm_size; - --- Add long random string to extend TOAST table to 1 block -INSERT INTO fsm_check_size -VALUES(0, (SELECT string_agg(md5(chr(i)), '') - FROM generate_series(1,100) i)); -VACUUM fsm_check_size; -SELECT pg_relation_size(reltoastrelid, 'main') AS toast_size, -pg_relation_size(reltoastrelid, 'fsm') AS toast_fsm_size -FROM pg_class WHERE relname = 'fsm_check_size'; - -DROP TABLE fsm_check_size; |
