What’s the relationship between files and pages in dbms

tags: learning database

content

  • a database (basically a collection of different tables) is stored on disks as files

    • files could be heap file, or sorted files
    • more common is heap file + indexes
    • e.g., sqlite stores the whole database in a single file
  • a file is like a binder, pages are different sheets in the binder, records (or tuples) are lines written in each of these pages

    • a file is a OS concept, underneath it’s blocks of binary data
    • a page corresponds to a block of data (the smallest unit of data access)

dbms-files-and-pages.excalidraw

⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠ You can decompress Drawing data with the command palette: ‘Decompress current Excalidraw file’. For more info check in plugin settings under ‘Saving’

Excalidraw Data

Text Elements

file

page

header

page stores records

dbms

finds db file

based on RecordId finds PageId and SlotId

finds record

user query record

header

101011101..

111011101..

101000101..

101011101..

files

logical concepts

111011101..

page

physical existence

files are just collections of blocks of data

each block of data is called a page

Link to original

up

down

reference