System and method predicting effect of cache on query elapsed response time during application development stage
AssigneeTata Consultancy Services Limited
InventorRekha Singhal
Life of this patent
Estimating the term…
Abstract
System(s) and method(s) for predicting effect of database cache on query elapsed response time during an application development stage are disclosed. Query executed on a database is classified and a query type is obtained. Database statistics are collected to further determine one or more cache miss factors with respect to the query type. One or more time components are calculated due to the one or more cache miss factors with respect to the query type. The one or more time components are used to predict the query elapsed response time for varying size of the database.
Claims9
A system implemented on a server predicting effect of cache on query elapsed response time during an application development stage, the system comprising:
- a processor;
- and
- a memory coupled to the processor, wherein the processor executes a plurality of modules stored in the memory, and wherein the plurality of modules comprise:
- a classification module to classify a query executed on a database to obtain a query type, wherein the query is classified based on a database access pattern of the query along with one or more keys associated with the query, wherein the key refers to one or more columns referred to in the query, wherein behavior of a cache access by the query depends on a data distribution pattern and a data access pattern that determines an order of key values used to access data and qualify relevant data in the database, and repeated data accesses are served from one of an operating system (OS) cache, and a database (DB) cache depending on the data access pattern and data distribution pattern in a table present in the database;
- a determination module to:
- collect one or more database statistics with respect to the query type, wherein the database statistics refer to the data distribution pattern and the data access pattern of the query;
- and
- determine one or more cache miss factors by using the database statistics, wherein the one or more cache miss factors predicts number of access of the cache by the query not found in the database cache, and wherein the one or more cache miss factors are determined by using a Blackbox approach, wherein a database cache miss is serviced from one of the OS cache or a hard disk, and wherein the determination module further:
- determines a Database Cache miss factor for Uniform Random (UR) access pattern and Database Cache miss factor for a Slotted Uniform Random (SUR) pattern, wherein all rows having a same key value for an index are randomly stored across all data blocks of the table in the UR access pattern;
- and
- determines an Operating System (OS) cache miss factor for Uniform Random (UR) access pattern, wherein the data distribution pattern of a key value in the SUR pattern sequentially divides the table into as many slots as a number of blocks having rows qualifying the key value such that each slot has at least one row for the key value;
- a calculation module to calculate one or more time components associated with processing of the query in the database with respect to the one or more cache miss factors;
- and
- a prediction module to predict the query elapsed response time by using the one or more time components for a varying size of the database,
- wherein the one or more time components comprises a Central Processing Unit (CPU) time and an Input-Output (IO) time associated with the processing of the query, wherein the CPU time includes a user time and a system time,
- wherein, for a database size larger than the database cache, the database cache miss is predicted to calculate the user time and the system time, and
- wherein, for a database size larger than the OS cache, the OS cache miss is estimated to calculate the system time and the IO time.
A method predicting an effect of cache on query elapsed response time during an application development stage, the method comprising:
- classifying a query executed on a database to obtain a query type, wherein the query is classified based on a database access pattern of the query along with one or more keys associated with the query, wherein the key refers to one or more columns referred to in the query, wherein behavior of a cache access by the query depends on a data distribution pattern and a data access pattern that determines an order of key values used to access data and qualify relevant data in the database, and repeated data accesses are served from one of an operating system (OS) cache, and a database (DB) cache depending on the data access pattern and data distribution pattern in a table present in the database;
- collecting one or more database statistics with respect to the query type, wherein the database statistics refer to the at least one data distribution pattern in the database and at least one data access pattern of the query collected inside the database;
- and
- determining one or more cache miss factors by using the database statistics, wherein the one or more cache miss factors predicts number of access of the cache by the query not found in the database cache, wherein a database cache miss is serviced from one of the OS cache or a hard disk, and wherein the determining of one or more cache miss factors further comprises:
- determining a Database Cache miss factor for Uniform Random (UR) access pattern and Database Cache miss factor for Slotted Uniform Random (SUR) pattern, wherein all rows having a same key value for an index are randomly stored across all data blocks of the table in the UR access pattern;
- and
- determining an Operating System (OS) cache miss factor for Uniform Random (UR) access pattern, wherein the data distribution pattern of a key value in the SUR pattern sequentially divides the table into as many slots as a number of blocks having rows qualifying the key value such that each slot has at least one row for the key value;
- calculating one or more time components associated with processing of the query in the database with respect to the one or more cache miss factors;
- and
- predicting the query elapsed response time by using the one or more time components for varying size of the database,
- wherein the one or more time components comprises a Central Processing Unit (CPU) time and an Input-Output (IO) time associated with the processing of the query, wherein the CPU time includes a user time and a system time,
- wherein, for a database size larger than the database cache, the database cache miss is predicted to calculate the user time and the system time, and
- wherein, for a database size larger than the OS cache, the OS cache miss is estimated to calculate the system time and the IO time.
A non-transitory computer readable medium having embodied thereon a computer program for predicting effect of cache on query elapsed response time during an application development stage, the method comprising:
- classifying a query executed on a database to obtain a query type, wherein the query is classified based on a database access pattern of the query along with one or more keys associated with the query, wherein behavior of a cache access by the query depends on a data distribution pattern and a data access pattern that determines an order of key values used to access data and qualify relevant data in the database, and repeated data accesses are served from one of an operating system (OS) cache, and a database (DB) cache depending on the data access pattern and data distribution pattern in a table present in the database;
- collecting one or more database statistics with respect to the query type, wherein the database statistics refer to the data distribution pattern in the database and the data access pattern of the query collected inside the database;
- determining one or more cache miss factors by using the database statistics, wherein the one or more cache miss factors predicts number of access of the cache by the query not found in the database cache, wherein a database cache miss is serviced from one of the OS cache or a hard disk, and wherein the determining of one or more cache miss factors further comprises:
- determining a Database Cache miss factor for Uniform Random (UR) access pattern and Database Cache miss factor for Slotted Uniform Random (SUR) pattern, wherein all rows having a same key value for an index are randomly stored across all data blocks of the table in the UR access pattern;
- and
- determining an Operating System (OS) cache miss factor for Uniform Random (UR) access pattern, wherein the data distribution pattern of a key value in the SUR pattern sequentially divides the table into as many slots as a number of blocks having rows qualifying the key value such that each slot has at least one row for the key value;
- calculating one or more time components associated with processing of the query in the database with respect to the one or more cache miss factors;
- and
- predicting the query elapsed response time by using the one or more time components for varying size of the database,
- wherein the one or more time components comprises a Central Processing Unit (CPU) time and an Input-Output (IO) time associated with the processing of the query, wherein the CPU time includes a user time and a system time,
- wherein, for a database size larger than the database cache, the database cache miss is predicted to calculate the user time and the system time, and
- wherein, for a database size larger than the OS cache, the OS cache miss is estimated to calculate the system time and the IO time.
Dependencies are inferred from the claim text.