×

Query hint specification

  • US 10,592,506 B1
  • Filed: 02/13/2013
  • Issued: 03/17/2020
  • Est. Priority Date: 02/13/2013
  • Status: Active Grant
First Claim
Patent Images

1. A system, comprising:

  • a memory;

    one or more processors coupled to the memory, wherein the memory comprises program instructions executable by the one or more processors to;

    receive, by a parser, a query to a database, wherein the query specifies a hint and a query block, wherein the hint is usable to optimize the query, wherein the hint includes a unique object identifier uniquely specifying an object recited within the query block to which the hint applies, wherein the unique object identifier corresponds to a nested query block of the query block, and wherein the unique object identifier is relative to the query block;

    determine, by an optimizer, a location of the specified object within the query block to which the hint applies according to an interpretation of the unique object identifier with respect to locations within the query block to locate the specified object in the query block, wherein the unique object identifier is specified from an unambiguous numbering scheme, the unambiguous numbering scheme corresponding to a specific scope of the query block in which objects are numbered sequentially inside the query block in an order of appearance to the parser;

    obtain, by the optimizer, a local reference of the unique object identifier by truncating a prefix of the unique object identifier, wherein the truncated prefix is an identifier of the query block;

    rewrite, by the optimizer, the query by inserting the hint at a top level of the determined query block location and replacing the unique object identifier in the hint with the local reference of the unique object identifier;

    select, by the optimizer, a query execution plan to optimize the rewritten query based, at least in part, on the application of the hint to the specified object; and

    execute, by a compute node, the query execution plan to perform the query to the database.

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