A method of refreshing a materialized view includes creating a materialized view based on a first result of a database query executed against a set of tables stored in a database and discovering a set of child storage objects associated with a parent storage object. The method also includes inserting, based on discovering the set of child storage objects, an entry into one or more tables of the set of tables, the entry including a child storage object of the set of child storage objects. The method further includes delaying a refresh of the materialized view until after the entry is inserted into the set of tables and then refreshing the materialized view, which is based on a second result of the database query executed against the set of tables.
Legal claims defining the scope of protection. Each claim is shown in both the original legal language and a plain English translation.
1. A method of refreshing a materialized view, comprising: creating a first materialized view based on a first result of a database query executed against a set of tables stored in a database; discovering a parent storage object; inserting, based on the discovering the parent storage object, a second entry into one or more tables of the set of tables, the second entry including the parent storage object; discovering a set of child storage objects associated with the parent storage object; wherein the discovering a set of child storage objects includes discovering the last child storage object of the set of child storage objects, and wherein the entry includes the last child storage object, the method further including: identifying a materialized view update timestamp for the second materialized view, the materialized view update timestamp indicating a last update time of the second materialized view; identifying an update timestamp of one or more tables of the set of tables, an update timestamp of a given table indicating a last update time of the given table; comparing the materialized view update timestamp to the update timestamp of one or more tables of the set of tables; and determining, based on the comparing, whether to refresh the second materialized view; inserting, based on the discovering a set of child storage objects, an entry into one or more tables of the set of tables, the entry including a child storage object of the set of child storage objects; wherein the parent storage object and the set of child storage objects are based on a storage hierarchy representing hardware and software resources for storing data at a storage system; updating a timestamp for the parent storage object with a timestamp of discovering a last of child storage object from among the set of child storage objects; delaying a refresh of the first materialized view based on the updated timestamp for the parent storage object and until after the entry is inserted into the one or more tables of the set of tables; and after the entry is inserted into the one or more tables of the set of tables, refreshing the first materialized view to determine a second materialized view, the second materialized view being based on a second result of the database query executed against the set of tables.
A method for efficiently updating materialized views in a database system involves creating an initial materialized view from a database query. As storage objects are added to the system, such as parent and child storage units within a hierarchical storage architecture, entries reflecting these objects are inserted into database tables. The system updates a timestamp for a parent storage object when its last child object is discovered. A refresh of the materialized view is delayed until these entries are inserted. Before refreshing, the system compares the materialized view's last update time against the last update times of the underlying tables. The materialized view is then refreshed, generating a new materialized view based on the updated tables.
2. The method of claim 1 , wherein the first materialized view is different from the second materialized view.
The method of refreshing a materialized view, as described previously, generates a first materialized view and a second materialized view and these two materialized views contain different data. The first materialized view before a refresh will contain data that is different than the second materialized view after the refresh. The database query that generates the first materialized view will return results that differ from the database query that generates the second materialized view.
3. The method of claim 1 , wherein the comparing includes determining whether the materialized view update timestamp is earlier than the update timestamp of the one or more tables of the set of tables, wherein in response to determining that the materialized view update timestamp is later than each update timestamp of the set of tables, determining to not refresh the second materialized view.
In the method of refreshing materialized views, the comparison between the materialized view update timestamp and the table update timestamps involves checking if the materialized view is older than any of the tables. If the materialized view's update timestamp is newer than all table update timestamps, indicating that the tables haven't been modified since the last view refresh, the system skips refreshing the materialized view. This prevents unnecessary refreshes when the underlying data hasn't changed.
4. The method of claim 3 , wherein in response to determining that the materialized view update timestamp is earlier than an update timestamp of the set of tables, determining to refresh the second materialized view.
Building on the materialized view refresh method, if the comparison determines that the materialized view is older than one or more of the underlying database tables (materialized view update timestamp is earlier than a table's update timestamp), then the system proceeds to refresh the materialized view. This ensures that the materialized view reflects the latest changes in the database tables, providing up-to-date information for reporting and analysis.
5. The method of claim 1 , further including: in response to determining to refresh the second materialized view, refreshing the second materialized view to determine a third materialized view; submitting a second database query to the third materialized view; and generating a report based on a result of the second database query.
Expanding on the method for refreshing materialized views, after determining to refresh the materialized view, a new, refreshed materialized view is created. A second database query is then executed against this refreshed view. The result of this query is used to generate a report. This process ensures that the report is based on the most current data available in the database, as reflected in the refreshed materialized view.
6. The method of claim 5 , further including: in response to determining to not refresh the second materialized view, submitting a second database query to the second materialized view; and generating a report based on a result of the second database query.
Expanding on the method for refreshing materialized views, if the system determines that a refresh is not needed (because the materialized view is up-to-date), a second database query is submitted against the existing, unrefreshed materialized view. A report is then generated based on the result of this query. This avoids unnecessary processing and ensures the report is generated quickly when the underlying data hasn't changed.
7. A computing device comprising: a memory containing machine readable medium comprising machine executable code having stored thereon instructions for performing a method of refreshing a materialized view; and a processor coupled to the memory, the processor configured to execute the machine executable code to: update, based on discovering a last child storage object associated with a parent storage object, a set of tables stored in a database; wherein the discovering a set of child storage objects includes discovering the last child storage object of the set of child storage objects, and wherein the entry includes the last child storage object, the system further including: identifying a materialized view update timestamp for the second materialized view, the materialized view update timestamp indicating a last update time of the second materialized view; identifying an update timestamp of one or more tables of the set of tables, an update timestamp of a given table indicating a last update time of the given table; comparing the materialized view update timestamp to the update timestamp of one or more tables of the set of tables; and determining, based on the comparing, whether to refresh the second materialized view; wherein the parent storage object and a set of child storage objects are based on a storage hierarchy representing hardware and software resources for storing data at a storage system; update a timestamp for the parent storage object with a timestamp of discovering the last child storage object from among the set of child storage objects; create a materialized view based on a result of a database query executed against the set of tables stored in the database; compare a materialized view update timestamp to an update timestamp of one or more tables of the set of tables, wherein the materialized view update timestamp indicates a last update time of a first materialized view and an update timestamp of a given table indicates a last update time of the given table; delay a refresh of the first materialized view based on the updated timestamp of the parent storage object and until after the last child storage object has been discovered; and refresh the first materialized view to determine a second materialized view when the last child storage object is discovered, wherein the second materialized view is based on one or more tables affected by the discovery of the last.
A computing device updates materialized views in a database system. It monitors a storage hierarchy of parent and child storage objects, updating database tables as new objects are discovered. Upon discovering the last child object for a parent, it timestamps the parent. The device creates an initial materialized view from a database query and compares the materialized view's timestamp against the timestamps of the underlying tables to decide whether to refresh it. The refresh is delayed until the last child storage object has been discovered. If a refresh is needed, the device generates a new materialized view based on the updated tables.
8. The system of claim 7 , wherein the system monitoring tool persists a discovery of the parent storage object and the set of child storage objects associated with the parent storage object to the database.
The system for managing materialized views, as described previously, uses a system monitoring tool that tracks the discovery of parent and child storage objects within the storage hierarchy and persists this information directly into the database. This persistence ensures that the relationships between storage objects are accurately reflected in the database tables, which are used to generate and refresh materialized views. This allows the device to have a record of discovered relationships for later usage.
9. The system of claim 7 , wherein the system monitoring tool spawns one or more monitors to discover child storage objects associated with the parent storage object.
The system for managing materialized views employs a system monitoring tool that has the ability to spawn multiple monitors, these monitors are created to search the file system for child storage objects associated with a given parent storage object. These monitors, running concurrently, accelerate the discovery process of the storage hierarchy, ensuring that materialized views are refreshed promptly as new storage objects are added to the system. The spawned monitors allow for faster refresh cycles.
10. The system of claim 7 , wherein the system monitoring tool determines whether the materialized view update timestamp is earlier than an update timestamp of the set of tables, wherein in response to determining that the materialized view update timestamp is later than each update timestamp of the set of tables, the system monitoring tool determines to not refresh the second materialized view, and wherein in response to determining that the materialized view update timestamp is earlier than an update timestamp of the set of tables, the system monitoring tool determines to refresh the second materialized view to determine a third materialized view.
In the materialized view management system, the system monitoring tool determines whether a refresh is needed by comparing the materialized view's update timestamp to the update timestamps of the underlying database tables. If the view is newer than all the tables, no refresh occurs. If the view is older than at least one table, the materialized view is refreshed, creating a third materialized view that reflects the updated data. The third materialized view is the basis for reporting.
11. The system of claim 7 , wherein the system monitoring tool determines whether the materialized view update timestamp is earlier than the update timestamp of the set of tables, wherein in response to determining that the materialized view update timestamp is earlier than an update timestamp of the set of tables, the system monitoring tool refreshes the materialized view and the reporting tool submits a query to the refreshed materialized view that is based on a second result of the database query executed against the set of tables.
The system managing materialized views assesses the need for a refresh by comparing the materialized view's timestamp with the timestamps of the database tables. When the view is determined to be older than at least one of the tables, the system proceeds to refresh the view. After the refresh, a reporting tool submits a query to the refreshed materialized view. This query is based on the updated data in the tables, ensuring that the report reflects the most current state of the storage system.
12. The system of claim 11 , further including: a reporting tool that receives a request for a report that uses data from one or more tables of the set of tables.
The materialized view system includes a reporting tool that receives requests for reports. These reports rely on data stored in one or more of the database tables. The integration of the reporting tool allows users to access and analyze the data managed by the system, providing insights into the storage system's performance, capacity, and other key metrics. The tool processes requests and generates a human-readable version of requested data.
13. The system of claim 12 , wherein responsive to the reporting tool receiving the request, the system monitoring tool compares the materialized view update timestamp to the update timestamp of one or more tables of the set of tables.
In the system managing materialized views with a reporting tool, when the reporting tool receives a request for a report, the system monitoring tool immediately compares the materialized view's update timestamp against the update timestamps of the underlying database tables. This comparison determines whether the materialized view needs to be refreshed to ensure the report is based on the most current data. The timestamp comparison is done only upon request.
14. The system of claim 12 , wherein the reporting tool submits a second database query to the second materialized view when the materialized view update timestamp is later than each update timestamp of the set of tables and submits the second database query to the third materialized view when the materialized view update timestamp is earlier than an update timestamp of the set of tables.
In the materialized view system with a reporting tool, if the materialized view is up-to-date (its update timestamp is later than all table timestamps), the reporting tool queries the existing materialized view. However, if the materialized view is outdated (its timestamp is earlier than a table's timestamp), the reporting tool queries the refreshed materialized view (the "third materialized view"). This ensures that the report is generated from the most recent data.
15. A non-transitory machine readable medium having stored thereon instructions for performing a method, comprising machine executable code which when executed by at least one machine, causes the machine to: create a first materialized view based on a first result of a database query executed against a set of tables stored in a database; discover a parent storage object; insert, based on the discovering the parent storage object, a second entry into one or more tables of the set of tables, the second entry including the parent storage object; discover a set of child storage objects associated with the parent storage object; wherein discovering a set of child storage objects includes discovering the last child storage object of the set of child storage objects, and wherein the entry includes the last child storage object, the machine executable code further causes the machine to: identify a materialized view update timestamp for the second materialized view, the materialized view update timestamp indicating a last update time of the second materialized view; identify an update timestamp of one or more tables of the set of tables, an update timestamp of a given table indicating a last update time of the given table; compare the materialized view update timestamp to the update timestamp of one or more tables of the set of tables; and determine, based on the compare, whether to refresh the second materialized view; insert, based on the discovering a set of child storage objects, an entry into one or more tables of the set of tables, the entry including a child storage object of the set of child storage objects; wherein the parent storage object and the set of child storage objects are based on a storage hierarchy representing hardware and software resources for storing data at a storage system; update a timestamp for the parent storage object with a timestamp of discovering a last of child storage object from among the set of child storage objects; delay a refresh of the first materialized view based on the updated timestamp for the parent storage object and until after the entry is inserted into the one or more tables of the set of tables; and after the entry is inserted into the one or more tables of the set of tables, refresh the first materialized view to determine a second materialized view, the second materialized view being based on a second result of the database query executed against the set of tables.
A non-transitory machine-readable medium contains instructions for refreshing materialized views. The instructions cause a machine to create a materialized view from a database query, discover storage objects, and insert entries into database tables. The refresh is delayed until the last child storage object has been discovered and its parent object timestamped. The machine compares the materialized view's update timestamp with the table update timestamps. Finally, the machine refreshes the materialized view, generating an updated materialized view based on the modified database tables.
16. The non-transitory machine readable medium of claim 15 , wherein the compare includes determining whether the materialized view update timestamp is earlier than the update timestamp of the one or more tables of the set of tables, wherein in response to determine that the materialized view update timestamp is later than each update timestamp of the set of tables, determine to not refresh the second materialized view.
The non-transitory machine-readable medium's instructions for refreshing materialized views, as described previously, include a comparison step. This step checks if the materialized view's update timestamp is older than the update timestamps of the database tables. If the materialized view is determined to be up-to-date, the instructions cause the machine to skip refreshing the materialized view.
17. The non-transitory machine readable medium of claim 15 , wherein the machine executable code further causes the machine to: in response to determining to refresh the second materialized view, refresh the second materialized view to determine a third materialized view; submit a second database query to the third materialized view; and generate a report based on a result of the second database query.
The non-transitory machine-readable medium's instructions include steps that, upon determining that a materialized view refresh is required, cause the machine to refresh the view, creating a new, updated materialized view. Then a second database query is executed against the refreshed materialized view, and a report is generated based on the result of that query. The generated report will be the newest available data.
18. The non-transitory machine readable medium of claim 15 , wherein the machine executable code further causes the machine to: in response to determining to not refresh the second materialized view, submitting a second database query to the second materialized view; and generating a report based on a result of the second database query.
In the context of the non-transitory machine-readable medium, if a materialized view refresh is not needed, the instructions cause the machine to submit a database query directly to the existing, unrefreshed materialized view. Then a report is generated based on the result of this query. This prevents the device from completing unneeded work that will not change the end report.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
October 6, 2014
June 27, 2017
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.