×

Merge join process

  • US 6,185,557 B1
  • Filed: 07/31/1998
  • Issued: 02/06/2001
  • Est. Priority Date: 07/31/1998
  • Status: Expired due to Term
First Claim
Patent Images

1. In a computer system having at least one processor, a method of joining data rows from an outer table with data rows from an inner table when the inner table rows are indexed on a data column common to both tables, the method comprising the steps of:

  • creating from the outer table a set of outer rows that satisfy a selection criteria;

    ensuring the set is sorted on a join column, wherein the join column is the common data column; and

    searching for a matching inner row for each outer row in sequence in the set until all the outer rows in the set have been searched, wherein initially a page-finder row is equated to the outer row first in set sequence, the searching for a matching inner row comprising the steps of;

    identifying an inner table data page based on the value of the join column of the page-finder record;

    retrieving the identified inner table data page;

    searching the inner table data page for a first match row, wherein the first match row is an inner row with a join column value that matches the join column value of the page-finder row, the searching of the inner table data page for a first match row comprising the steps of;

    discarding the page-finder row if no first match row is found; and

    if the first match row is found, marking the first match row as a join row, assigning to a next key the value of the join column of the inner row that sequentially follows the first match row on the inner table data page, and assigning to a last key the largest join column value of an inner row stored on the inner table data page; and

    if a first match is found on the inner table data page, searching the inner table data page until the value of the join column of an outer row is greater than the last key, the searching of the data page for a next match row comprising the steps of;

    selecting an outer row that follows the page-finder row in set sequence;

    discarding the outer row if the outer row has a join column value less than the next key;

    if the join column value of the outer row is not less than the next key, searching the data page for a next match row, wherein the next match row is an inner row with a join column value that matches the join column value of the outer row; and

    if a next match row is found, marking the next match row as a join row and assigning to the next key the value of the join column of the inner row that sequentially follows the next match row on the inner table data page; and

    if the join column value of an outer row is greater than the last key, equating the page-finder row to the outer row with the join column value that is greater than the last key.

View all claims
  • 12 Assignments
Timeline View
Assignment View
    ×
    ×