×

Caching execution plans for queries that use timestamps

  • US 8,250,064 B1
  • Filed: 04/06/2010
  • Issued: 08/21/2012
  • Est. Priority Date: 04/06/2010
  • Status: Active Grant
First Claim
Patent Images

1. A method comprising:

  • receiving a query Q1 in a computer system programmed as a database, Q1 including a predicate, the predicate including a reference to a current timestamp of time TT1, the database having R data structures;

    the computer system creating a plan, Plan 1, to execute Q1, Plan 1 including the identification of a first set of data structures, P1, to be accessed in executing Plan 1, at the current timestamp of time TT1, the number of data structures in P1 being less than R;

    the computer system determining that Plan 1 is valid for a period of time by determining that a plan, Plan 2, to execute Q1 during a period between TT1 and TT2, TT2 being later than TT1, accesses a second set of data structures, P2, P2 being contained in P1;

    storing in a cache;

    Plan 1; and

    an indication that Plan 1 is valid for the period of time;

    receiving a query Q2 in the database, Q2 including a predicate, the predicate including a reference to a current timestamp of time TT3; and

    determining that Q2 is equivalent to Q1 and that TT3 is in the period between TT1 and TT2 and in response, using the cached plan, Plan 1, to execute Q2.

View all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×