×

Selectivity-based optimized-query-plan caching

  • US 8,224,806 B2
  • Filed: 07/31/2009
  • Issued: 07/17/2012
  • Est. Priority Date: 07/31/2009
  • Status: Expired due to Fees
First Claim
Patent Images

1. An optimized-query-plan caching subsystem within a query-processing computer system, the optimized-query-plan caching subsystem comprising:

  • an optimized-query-plan cache contained in electronic memory of a computer system or distributed across one or more electronic memories and mass-storage devices within a computer system; and

    a caching component that executes within the query-processing computer system and that stores optimized query plans in the optimized-query-plan cache in association with a representation of an equivalence group and in association with a representation of an equivalence class contained within the equivalence group, and that retrieves optimized query plans from the optimized-query-plan cache by;

    receiving a query plan and a predicate selectivity computed for the query plan;

    determining whether an equivalence group for the query plan is stored in the optimized-query-plan cache;

    when an equivalence group for the query plan is stored in the optimized-query-plan cache, traversing equivalence-class representations of equivalence class contained in the equivalence group to identify an equivalence class that corresponds to the received predicate selectivity computed for the query plan; and

    when an equivalence class that corresponds to the received predicate selectivity is identified, retrieving an optimized query plan stored in association with the equivalence class that has been identified,wherein an equivalence class corresponds to the received predicate selectivity when;

    the received predicate selectivity is equal to a single predicate selectivity that defines the equivalence class;

    the received predicate selectivity is greater than or equal to a low predicate selectivity and less than or equal to a high predicate selectivity that together define the equivalence class;

    the received predicate selectivity is within a threshold distance of a single predicate selectivity that defines the equivalence class;

    orthe received predicate selectivity is within a threshold distance of a low predicate selectivity or a high predicate selectivity that together define the equivalence class.

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