IP Library Granted Patent US 8,799,271
Granted Patent B2
US 8,799,271 · App. 13/012,868 · Granted Aug 5, 2014

Range predicate canonization for translating a query

Inventors: Yuval Sherman (Haifa, IL); Barry Lynn Fritchman (Lake Forest, CA)
Assignee: Hewlett-Packard Development Company, L.P.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,799,271
App. No.
13/012,868
Granted
Aug 5, 2014
Kind
B2
Abstract

A system and methods for implementing a materialized view for a query are provided. The query system includes a database that includes a base table. The base table can include a set of data. The query system also includes a materialized view associated with a portion of the set of data, and a MVQR component to translate each of a range predicate of the materialized view and a range predicate of a query into a canonical range representation (CRR) format in materialized view metadata and query metadata, respectively, to enable the query to search the materialized view.

Claims (29)

1. A query system comprising:

a database comprising a base table, the base table comprising a set of data arranged in a plurality of columns;

a materialized view associated with a portion of the set of data;

a materialized view query rewrite (MVQR) component to translate each of a range predicate of the materialized view for a given column of the base table and a range predicate of a query into a canonical range representation (CRR) format to generate a materialized view metadata for the given column and a query metadata, respectively, and to compare the materialized view metadata and the query metadata to determine whether the query matches the materialized view to enable the query to search the materialized view, the MVQR component being further to merge a first range associated with a first range predicate and a second range associated with a second range predicate into a third range corresponding to a single range predicate in the CRR format and comprising both the first range and the second range, the first and second range predicates being associated with at least one of the query and the materialized view and the first and second ranges comprising one of overlapping and adjacent values with respect to each other; and

a query optimizer to choose from among a plurality of possible search plans for searching the base table for data associated with the range predicate of the query, the materialized view being included in the plurality of possible search plans by the query optimizer.

2. The system of claim 1 , wherein the MVQR component is further to enable search of the materialized view by the query in response to determining that the query is subsumed by the materialized view based on the materialized view metadata and the query metadata.

3. The system of claim 1 , wherein the MVQR component is further to translate a data type associated with at least one of the query and the materialized view into CRR format.

4. The system of claim 1 , wherein the MVQR component is further to translate a plurality of range predicates associated with at least one of the query and the materialized view that are connected by a Boolean operator to the single range predicate in CRR format.

5. The system of claim 4 , wherein the plurality of range predicates associated with at least one of the query and the materialized view comprises a NULL value.

6. A non-transitory computer readable medium having computer readable instructions comprising:

a catalogue manager to create a materialized view associated with a portion of a set of data represented by a base table;

a compiler to receive a query programmed to search the base table; and

an MVQR component to translate a range predicate of the materialized view into a canonical range representation (CRR) format in materialized view metadata, to translate a range predicate of the query into a CRR format in query metadata, to compare the materialized view metadata and the query metadata, and to enable a search of the materialized view by the query if the query metadata is subsumed by the materialized view metadata, the MVQR component being further to merge a first range associated with a first range predicate and a second range associated with a second range predicate into a third range corresponding to a single range predicate in the CRR format and comprising both the first range and the second range, the first and second range predicates being associated with at least one of the query and the materialized view and the first and second ranges comprising one of overlapping and adjacent values with respect to each other; and

a query optimizer to select a search plan from among a plurality of possible search plans for searching the base table for data associated with the range predicate of the query, the materialized view being included in the plurality of possible search plans by the query optimizer.

7. The computer readable medium of claim 6 , wherein the MVQR component is further to translate a plurality of range predicates associated with at least one of the query and the materialized view that are connected by a Boolean operator to a single range predicate in CRR format.

8. The computer readable medium of claim 6 , wherein the MVQR component is further to translate associated with at least one of the query and the materialized view into CRR format.

9. The computer readable medium of claim 6 , wherein the MVQR component is to translate the range predicate of the materialized view for a given column of the base table and to translate the range predicate of the query into the CRR format into the materialized view metadata for the given column of the base table and the range predicate of the query, respectively, into the CRR format.

10. A method comprising:

generating a materialized view associated with a portion of a set of data represented by a base table;

translating a range predicate of the materialized view into a canonical range representation (CRR) format in materialized view metadata;

receiving a query programmed to search the base table;

selecting from among a plurality of possible search plans that includes the materialized view via a query optimizer for searching the base table for data associated with the range predicate of the query;

translating a plurality of range predicates of the query that are connected by a Boolean operator into a single range-oriented predicate in a CRR format in query metadata, wherein translating at least one of the range predicate of the materialized view and the plurality of range predicates of the query comprises translating a data type associated with the materialized view into CRR format;

merging a first range associated with a first of the plurality of range predicates and a second range associated with a second of the plurality of range predicates into a third range corresponding to a single range predicate in the CRR format and comprising both the first range and the second range, the first and second of the plurality of range predicates being associated with at least one of the query and the materialized view and the first and second ranges comprising one of overlapping and adjacent values with respect to each other;

comparing the materialized view metadata and the query metadata;

enabling a search of the materialized view by the query if the query metadata is subsumed by the materialized view metadata; and

searching the materialized view via the query in response to the materialized view being selected as a most efficient one of the plurality of possible search plans by the query optimizer and in response to enabling the search.

11. The method of claim 10 , wherein translating the plurality of range predicates of the query comprises translating a first range and a second range comprising one of overlapping and adjacent values with respect to each other into a third range in CRR format, the third range comprising both the first range and the second range.

12. The method of claim 10 , wherein translating the range predicate associated with the materialized view comprises translating the range predicate associated with the materialized view for a given column of the base table into the materialized view metadata for the given column of the base table.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 9, 2015
From: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
To: HEWLETT PACKARD ENTERPRISE DEVELOPMENT LP
Reel/Frame 037079/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 25, 2011
From: SHERMAN, YUVAL; FRITCHMAN, BARRY
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 025690/0395 →
Continuity (1)
Related Publication 20120191697A1 · Jul 26, 2012