1. Gyanastra
  2. Database Systems
  3. Join Order, Merge Join Seek-Transfer Model and Non-Key Index Join
  4. The Cost Model: Seeks and Transfers
Free lesson, no account needed 4 min read

Database Systems · Join Order, Merge Join Seek-Transfer Model and Non-Key Index Join

The Cost Model: Seeks and Transfers

This chapter is about the cost of joins: how many block transfers and seeks each join algorithm needs, how to estimate the size of a join's output, and how to pick the order in which to join three or more relations. We work in the seek-and-transfer cost model used by Silberschatz–Korth–Sudarshan (SKS) and by most GATE questions.


We measure the cost of a query plan by two numbers:

  • tTt_T = time to transfer one block (sequential read/write).
  • tSt_S = time to seek (random access) to a block.

Total cost =b⋅tT+s⋅tS= b \cdot t_T + s \cdot t_S, where bb = number of block transfers and ss = number of seeks. GATE usually asks for the pair (b,s)(b, s) or for the cost with tT,tSt_T, t_S given.

Notation (SKS convention, used throughout unless stated):

SymbolMeaning
brb_rnumber of blocks of relation rr
nrn_rnumber of tuples of relation rr
V(A,r)V(A,r)number of distinct values of attribute AA in rr
MMnumber of main-memory blocks available for the join
bbb_bnumber of buffer blocks per input in merge join
hhheight of a B⁺-tree index (number of index levels)

Pages 1–2 of 2