File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
Original file line number Diff line number Diff line change @@ -632,7 +632,7 @@ hash_xlog_squeeze_page(XLogReaderState *record)
632
632
XLogRecPtr lsn = record -> EndRecPtr ;
633
633
xl_hash_squeeze_page * xldata = (xl_hash_squeeze_page * ) XLogRecGetData (record );
634
634
Buffer bucketbuf = InvalidBuffer ;
635
- Buffer writebuf ;
635
+ Buffer writebuf = InvalidBuffer ;
636
636
Buffer ovflbuf ;
637
637
Buffer prevbuf = InvalidBuffer ;
638
638
Buffer mapbuf ;
Original file line number Diff line number Diff line change @@ -298,6 +298,20 @@ ROLLBACK;
298
298
INSERT INTO hash_cleanup_heap SELECT 1 FROM generate_series(1, 500) as i;
299
299
CHECKPOINT;
300
300
VACUUM hash_cleanup_heap;
301
+ TRUNCATE hash_cleanup_heap;
302
+ -- Insert tuples to both the primary bucket page and overflow pages.
303
+ INSERT INTO hash_cleanup_heap SELECT 1 FROM generate_series(1, 500) as i;
304
+ -- Fill overflow pages by "dead" tuples.
305
+ BEGIN;
306
+ INSERT INTO hash_cleanup_heap SELECT 1 FROM generate_series(1, 1500) as i;
307
+ ROLLBACK;
308
+ -- And insert some tuples again. During squeeze operation, these will be moved
309
+ -- to other overflow pages and also allow overflow pages filled by dead tuples
310
+ -- to be freed. Note the main purpose of this test is to test the case where
311
+ -- we don't need to move any tuple from the overflow page being freed.
312
+ INSERT INTO hash_cleanup_heap SELECT 1 FROM generate_series(1, 50) as i;
313
+ CHECKPOINT;
314
+ VACUUM hash_cleanup_heap;
301
315
-- Clean up.
302
316
DROP TABLE hash_cleanup_heap;
303
317
-- Index on temp table.
Original file line number Diff line number Diff line change @@ -284,6 +284,23 @@ INSERT INTO hash_cleanup_heap SELECT 1 FROM generate_series(1, 500) as i;
284
284
CHECKPOINT;
285
285
VACUUM hash_cleanup_heap;
286
286
287
+ TRUNCATE hash_cleanup_heap;
288
+
289
+ -- Insert tuples to both the primary bucket page and overflow pages.
290
+ INSERT INTO hash_cleanup_heap SELECT 1 FROM generate_series(1 , 500 ) as i;
291
+ -- Fill overflow pages by "dead" tuples.
292
+ BEGIN ;
293
+ INSERT INTO hash_cleanup_heap SELECT 1 FROM generate_series(1 , 1500 ) as i;
294
+ ROLLBACK ;
295
+ -- And insert some tuples again. During squeeze operation, these will be moved
296
+ -- to other overflow pages and also allow overflow pages filled by dead tuples
297
+ -- to be freed. Note the main purpose of this test is to test the case where
298
+ -- we don't need to move any tuple from the overflow page being freed.
299
+ INSERT INTO hash_cleanup_heap SELECT 1 FROM generate_series(1 , 50 ) as i;
300
+
301
+ CHECKPOINT;
302
+ VACUUM hash_cleanup_heap;
303
+
287
304
-- Clean up.
288
305
DROP TABLE hash_cleanup_heap;
289
306
You can’t perform that action at this time.
0 commit comments