dbms query cost merge-sort

  • Can anyone please explain the red marker line in above. I find it difficult to understand.

    This is given in my DBMS book on external merge sort cost
    does the records of R & S sorted first based on their joining columns with order by and then thereafter goes to buffer in chunks ?

  • The tables are first sorted on A and B (this is not by the ORDER BY in the query but an internal sort that's part of the join). 
    Then the pages are read in pairs to the buffers. As each table is now already sorted so they just need one scan to match the join condition.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply