mirror of
				https://github.com/postgres/postgres.git
				synced 2025-10-31 10:30:33 +03:00 
			
		
		
		
	hash: Refactor bucket squeeze code.
In preparation for adding write-ahead logging to hash indexes, refactor _hash_freeovflpage and _hash_squeezebucket so that all related page modifications happen in a single section of code. The previous coding assumed that it would be fine to move tuples one at a time, and also that the various operations involved in freeing an overflow page didn't necessarily all need to be done together, all of which is true if you don't care about write-ahead logging. Amit Kapila, with slight changes by me.
This commit is contained in:
		| @@ -303,11 +303,14 @@ extern Datum hash_uint32(uint32 k); | ||||
| extern void _hash_doinsert(Relation rel, IndexTuple itup); | ||||
| extern OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf, | ||||
| 			   Size itemsize, IndexTuple itup); | ||||
| extern void _hash_pgaddmultitup(Relation rel, Buffer buf, IndexTuple *itups, | ||||
| 					OffsetNumber *itup_offsets, uint16 nitups); | ||||
|  | ||||
| /* hashovfl.c */ | ||||
| extern Buffer _hash_addovflpage(Relation rel, Buffer metabuf, Buffer buf, bool retain_pin); | ||||
| extern BlockNumber _hash_freeovflpage(Relation rel, Buffer ovflbuf, Buffer wbuf, | ||||
| 				   BufferAccessStrategy bstrategy); | ||||
| extern BlockNumber _hash_freeovflpage(Relation rel, Buffer bucketbuf, Buffer ovflbuf, | ||||
| 				   Buffer wbuf, IndexTuple *itups, OffsetNumber *itup_offsets, | ||||
| 			 Size *tups_size, uint16 nitups, BufferAccessStrategy bstrategy); | ||||
| extern void _hash_initbitmap(Relation rel, HashMetaPage metap, | ||||
| 				 BlockNumber blkno, ForkNumber forkNum); | ||||
| extern void _hash_squeezebucket(Relation rel, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user