×

Tracking and maintaining expression statistics across database queries

  • US 10,372,706 B2
  • Filed: 05/04/2016
  • Issued: 08/06/2019
  • Est. Priority Date: 07/29/2015
  • Status: Active Grant
First Claim
Patent Images

1. A method comprising:

  • maintaining, by a database server instance, an expression statistics store that includes metadata values for each expression of a plurality of expressions;

    wherein each expression of the plurality of expressions, when evaluated by the database server instance, causes the database server instance to perform a corresponding operation using values from at least one column of a table in a database managed by the database server instance;

    receiving, by the database server instance, a database query;

    parsing, by the database server instance, the database query to identify expressions within the database query;

    based on the parsing, identifying an occurrence of a particular expression within the database query;

    in response to identifying the occurrence of the particular expression within the database query, the database server instance updating the expression statistics store to reflect the occurrence of the particular expression;

    determining, from the metadata values maintained for the particular expression, a time-period-based cumulative cost for the particular expression;

    wherein the time-period-based cumulative cost is determined, based at least in part, on a fixed cost per evaluation of the particular expression and on an evaluation count that tracks how many times the particular expression was evaluated;

    based, at least in part, on the time-period-based cumulative cost for the particular expression, performing at least one of;

    storing an evaluation result for the particular expression in an in-memory cache, and modifying an execution plan of a query that includes the particular expression to access the evaluation results in the in-memory cache rather than evaluate the particular expression;

    rearranging an order in which expressions in a query that includes the particular expression are evaluated;

    changing a level of compression applied to a column or database object referenced in the particular expression;

    determining where to store a column or database object referenced in the particular expression;

    ordetermining a format for storing a column or database object referenced in the particular expression.

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