how to find a record physically

tags: learning database

content

in a heap file, there are generally two ways to access data:

  • direct access with Record Id
    • the record id contains a page id and a slot id
      • RID = (page_id, slot_number)
    • dbms locates the page on disk using page id
    • dbms looks up the slot in the page’s slot directory, retrieves record’s offset and length (normally fixed length), and returns the tuple
  • sequential scan
    • scan page-by-page until the record is found or all records are read

up

down

reference