![]() Index scans follow the HOT chain to find the appropriate tuple. PostgreSQL doesn’t have to modify indexes.Since the external address of the tuple stays the same, the original index entry can still be used.There are two main advantages of HOT updates: To access the heap only tuple, PostgreSQL has to follow the “HOT chain” within the block. The external address of the row (the original line pointer) remains unchanged. That only works if the new and the old version of the row are in the same block. Instead, a “forwarding address” (its line pointer number) is stored in the old row version: This indirect reference allows PostgreSQL to reorganize a page internally without changing the outside appearance.Ī Heap Only Tuple is a tuple that is not referenced from outside the table block. The array of “line pointers” is stored at the beginning of the page, and each points to an actual tuple. To understand HOT, let’s recapitulate the layout of a table page in PostgreSQL: The new row version was added to block 1, which still has free space. So the first 226 rows fill block 0, and the last 9 are in block 1. The ctid consists of two parts: the “block number”, starting at 0, and the “line pointer” (tuple number within the block), starting at 1. Let’s look at the physical address (“current tuple ID” or ctid) of each table row: This table is slightly more than one 8KB block long. Let’s create a simple table with 235 rows: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |