[prev] 10 [next]

Insertion with Prim.Index

Overview:

insert tuple into page P
find location for new entry in index file
   // could check whether it already exists
insert new index entry (k,P+i) into index file 
   // P+i is tupleID = (PageID + offset within page)

Problem: order of index entries must be maintained

  • need to avoid overflow pages in index
  • so we need to reorganise index file

On average, this requires us to read/write half of index file.

Costinsert,prim  =  (log2i)r + i/2.(1r+1w) + (1+Ov)r + (1+δ)w