METHOD FOR EXECUTING QUERIES ON STREAMING DATA USING GRAPHIC PROCESSING UNITS

Information

  • Patent Application
  • 20160283556
  • Publication Number
    20160283556
  • Date Filed
    March 18, 2014
    10 years ago
  • Date Published
    September 29, 2016
    7 years ago
Abstract
The present invention discloses a method for real time execution of SQL queries on data stream using HWA units. The method comprising the step of: receiving data stream and injecting directly in to the one more HWA units, receiving SQL query and identifying SQL query type, statistically real time analyzing multiple data streams and calculating statistics coefficients and characteristics of data stream, creating metadata based on statistical analysis in case the calculated statistics coefficients and characteristics obey predefined rules and using created metadata for SQL execution based on SQL identified SQL type in case the calculated statistics coefficients and characteristics obey predefined rules. The steps of statistical data analysis and creation of meta data are performed by the HWA.
Description
BACKGROUND
1. Technical Field

The present invention relates generally Method for Executing SQL Queries on data streams directly on HWA unit.


BRIEF SUMMARY

The present invention provides a method for real time execution of SQL queries on data stream using HWA units. The method comprising the step of: receiving data stream and injecting directly in to the one more HWA units, receiving SQL query and identifying SQL query type, statistically real time analyzing multiple data streams and calculating statistics coefficients and characteristics of data stream, creating metadata based on statistical analysis in case the calculated statistics coefficients and characteristics obey predefined rules and using created metadata for SQL execution based on SQL identified SQL type in case the calculated statistics coefficients and characteristics obey predefined rules.


According to some embodiments of the present invention the steps of statistical data analysis and creation of meta data are performed by the HWA.


According to some embodiments of the present invention the statistically real time analyzing includes at least one of: data distribution pattern in time, data points are independent probabilistically one to another, no correlation or no clustering between data units.


According to some embodiments of the present invention the creation of metadata for the data stream include one of the following: histogram, splitters or bloom filter. According to some embodiments of the present invention the creation of metadata for the data stream include for set operation include creating hashing function to minimize collisions and to perform join with minimal amount of false positives caused by imperfect hash function collisions.


According to some embodiments of the present invention the creation of metadata for the data stream for sort operation, include applying histogram efficient Sorting. According to some embodiments of the present invention the creation of metadata for the data stream for sort operation, include dynamically clustering data groups for sorting, such as data elements between bins is optimized to fit onboard memory size of the HWA unit.


According to some embodiments of the present invention brute force sorting is applied on data stream queries in case data in uniformly distributed.


According to some embodiments of the present invention using the created metadata includes improving execution of the SET or sorting SQL queries in case data in not uniformly distributed.


According to some embodiments of the present invention using the created meta data for SET operation includes creating hash function and storing temporary results of SQL queries incase data size exceeds GPU on board available memory.


According to some embodiments of the present invention using the created meta data for SET includes histogram optimization, in case the data streaming has statistical properties that allow performing efficient Sorting operations.


The present invention provides a system for real time execution of SQL queries on data stream using only HWA units, wherein the data stream is injected directly in to the one more HWA units. The system comprising the step of: SQL analyzer module for receiving SQL query and identifying SQL query type and statistically, analyzing module implemented in the HWA unit for real time analyzing multiple data streams and calculating statistics coefficients and characteristics of data stream and execution module implemented in the HWA unit for creating metadata based on statistical analysis in case the calculated statistics coefficients and characteristics obey predefined rules and using created metadata for SQL execution based on SQL identified SQL type in case the calculated statistics coefficients and characteristics obey predefined rules.


According to some embodiments of the present invention the statistically real time analyzing include calculating major statistics coefficients on the GPU.


According to some embodiments of the present invention the statistically real time analyzing include Identifying in real time statically characteristics of the streamed including at least one of: data distribution pattern in time, data points are independent probabilistically one to another, no correlation or no clustering between data units.


According to some embodiments of the present invention the creation of metadata for the data stream include one of the following: histogram, splitters or bloom filter. According to some embodiments of the present invention the creation of metadata for the data stream include for set operation include creating hashing.


According to some embodiments of the present invention the creation of metadata for the data stream for sort operation, include applying histogram efficient Sorting.


According to some embodiments of the present invention the creation of metadata for the data stream for sort operation, include dynamically clustering data groups fro sorting, such as data elements between bins is optimized to fit onboard memory size of the HWA unit.


According to some embodiments of the present invention brute force sorting is applied on data stream queries in case data in uniformly distributed.


According to some embodiments of the present invention using the created metadata includes improving execution of the SET or sorting SQL queries in case data in not uniformly distributed.


According to some embodiments of the present invention using the created meta data for SET operation includes creating hash function and storing temporary results of SQL queries incase data size exceeds GPU on board available memory.


According to some embodiments of the present invention using the created meta data for SET include histogram optimization, in case the data streaming has statistical properties that allow performing efficient Sorting operations.


These, additional, and/or other aspects and/or advantages of the present invention are: set forth in the detailed description which follows; possibly inferable from the detailed description; and/or learnable by practice of the present invention.





BRIEF DESCRIPTION OF THE DRAWINGS

The present invention will be more readily understood from the detailed description of embodiments thereof made in conjunction with the accompanying drawings of which:



FIG. 1 illustrates a block diagram showing the entities and modules involved in executing queries on data stream, according to some embodiments of the invention.



FIG. 2 is a flow diagram Statistics Analyzer module processing, according to some embodiments of the invention;



FIG. 3 is a flow diagram of the SQL analyzer module processing, according to some embodiments of the invention;



FIG. 4 is a flow diagram of the SQL execution module processing, according to some embodiments of the invention;



FIG. 5 is a flow diagram of the decision module processing according to some embodiments of the invention; and





DETAILED DESCRIPTION

Before explaining at least one embodiment of the invention in detail, it is to be understood that the invention is not limited in its application to the details of construction and the arrangement of the components set forth in the following description or illustrated in the drawings. The invention is applicable to other embodiments or of being practiced or carried out in various ways. Also, it is to be understood that the phraseology and terminology employed herein is for the purpose of description and should not be regarded as limiting.


The term “HWA (HardWare Accelerator):” as used herein in this application, is defined as any hardware that connected to main Central Processing Unit (CPU) through a Peripheral Component Interconnect (PCI) bus and encompasses a multiple computational cores inside. Example: GPGPUs (with 1000s of cores), Intel MICs (with 10s of cores). GPU or MIC or accelerator in this text are used interchangeably.


In the context of present invention the GPU is being directly fed by data streamed from other device attached to PCI bus of the same host. This configuration could be used on single computer or multiple computers.


The term “SQL query” includes any database based query in any language on data that is streamed from storage or any other source.


The present invention provides a cluster based architecture where HWA units are switching data between cluster instances, bypassing the host CPU. In this cluster configuration HWA units are continuously operating on data streams which are originated from the network. This unique configuration suggested by the present invention, has advantage over known clustering configuration which comprise: CPU and HWA unit, the scheduling in such configuration support the processing of data by HWA units which comes from host CPU memory and not directly from network from other PCI device. In this known configuration the processed data stream is first received at the host machine memory, which have large memory size and buffering capability by using external storage. To enable efficient stream processing in the configuration as suggested by the present invention where the HWA units are fed directly and directly return the processed results to network using minimum buffering memory, it is required to optimize the data processing as will be further bellow.



FIG. 1 illustrates a block diagram showing the entities and modules involved in executing queries on data stream in real time, according to some embodiments of the invention. The SQL query may be received from a user or any other entity (12) to be executed on a HWA unit (20), to be operated on real time data received directly from a data network card (10). The received data is injected directly into the one or more HWA units, by the BCI buss 14 for analyzing the data stream statistics by the analyzer 30 at the HWA unit (20) and creating metadata based on said data analysis. The created metadata is stored in statistical metadata database (18). The SQL queries are assigned by the Scheduling module 16 and are analyzed by SQL analyzer at the CPU 15 (optionally at the HWA unit). The SQL execution module 50 perform the SQL query on the HWA based on SQL analyzing results and created metadata, according predefined rules applied by the decision module 60 running on the CPU 15 (or optionally on the HWA unit). Optionally some of the execution results are saved in temporal storage medium 20 in case the HWA memory is overloaded.



FIG. 2 is a flow diagram Statistics Analyzer module processing, according to some embodiments of the invention. At the first step, the analyzer module performs real time parallel statistical analysis on multiple segments of data streams (step 302), based on the statistical analysis are calculated major statistics coefficients (step 304) on the HWA and statistical characteristics of the streamed are identified (step 306). The statistical characteristics include at least one of: data distribution pattern in time, (e.g. uniformly), probabilistic dependency between data points, correlation or clustering/non clustering between data units of the data stream. The calculated statistics coefficients and identified statistical characteristics are conveyed to the decision module 50 at the CPU (optionally on the HWA unit). At the next step the statistical analysis is stored as an off-line copy and the database 20 (308.


Based on stored statistical analysis is created metadata for the data stream, such metadata may include: a histogram, splitters or bloom filter. The relevant metadata is created in accordance with the decision module 50 instruction based on predefined rules (step 310).


Optionally, for set operation, a hashing function is created for minimizing collisions and to performing join operations with minimal amount of false positives which may be caused by imperfect hash function collisions when performed at the CPU (step 312).


Optionally for sort operation is activated histogram function, in case the data streaming in, has appropriate statistical properties such as: well defined clustering or good correlation results. (step 312).


According to some embodiments of the present invention it is suggested to dynamically and continuously, control the group clustering in run time by determining the number of data elements between bins. This clustering optimize the groups size while maintaining the total number of sorting elements in each group during sorting operation to fit a single HWA memory size. Optionally, sorting operation is not bounded to use a single HWA and can processed by several HWA units simultaneously. This optimization over the group clustering, which support the adjusting bins, such as the data size between bins fits the HWA unit, is a unique feature of the present invention for the supporting ifs the clustering configuration of the HWA units which enable directing feeding from the network using minimum buffering. When sorting the streamed data on HWA unit, the unit memory may overflow frequently. For avoiding memory overflow, it is suggested according to some embodiments of the present invention, to dynamically adjust the number of bins by using V-optimal histogram algorithm or any other known in prior art to set the number of data elements between bins. This approach allows, controlling the data size residing in HWA memory and enables external sorting for streams.



FIG. 3 is a flow diagram of the SQL analyzer module processing, according to some embodiments of the invention. At the first step, the SQL query format is checked (step 402), for identifying the type of the SQL query (step 404). The type of the SQL query may be at least one of: filter/range, aggregate, Set operations such as join, Sorting etc. The type of the SQL query is conveyed to the execution module 50 and/or decision module 40 (step 406).


When, HWAs units are operating in cluster mode and connected directly to network adapters, it is suggested that each query will be presented in tree structure, where each node represent an operation of the SQL query, hence, while processing, the data streams will flow between tree nodes.



FIG. 4 is a flow diagram of the SQL execution module processing, according to some embodiments of the invention. At the first steps are received the following information: data stream, ifs statistical analysis results (step 502), the SQL query, including the type identification and the decision module instructions (step 504). In case the data is uniformly distributed, brute force sorting operation is applied on data stream queries in accordance with instruction of the decision module (step 506). In case data is not uniformly distributed, the statistical metadata that was created at the beginning of the data stream is utilized repeatedly throughout the query execution process for improving the execution of the SET or sorting SQL operations in accordance with instruction of the decision module (step 508). The statistical metadata may be calculated periodically according to data mining algorithms, Hash function may be created accordingly for SET operation. In case data size exceeds HWA on board available memory temporary results of SQL queries are stored in cache memory 22, in accordance with decision module instruction (step 510).



FIG. 5 is a flow diagram of the decision module processing according to some embodiments of the invention. At the first steps are received the statistical analysis calculation and statistical characteristics from the HWA (step 602), and identification of SQL query (step 604). Based on received data, the decision module applies predefined rules to determine operation of metadata creation and execution operation. For example, in case the data stream is uniformly distributed or no correlation, or no clustering is identified between data stream units, the decision module instruct the HWA to apply brute force sorting operation on data stream (step 606). In case data is not uniformly distributed or no correlation or clustering is found between the data stream units HWA, the decision module instructs the HWA analyzer module to create metadata for improving execution of the SET or sorting SQL operations (step 608). Incase data size exceeds HWA on board available memory during Set operation such as join, the decision modules instructs the HWA to Store temporary results of SQL queries execution in the database 22 (step 610).


In case the data streaming in has statistical properties that allow performing efficient Sorting operations, instruct the HWA to activate histogram optimization (step 612). For example the following sequence: 1 9 4 5 3 1 0 8 6: there is no pattern for efficient Sorting, but the following sequence 1 1 1 1 5 5 5 9 9 9, we a pattern can be detected: group of 1's, 5's and 9's and define the clusters by using k-means clustering algorithm on GPU and for sorting can be applied only on the clusters instead of applying it on the whole stream and return the requested sorting result.


Each instruction is sent in real time to the execution module 50 or the analyzer module 30 (step 614).


In the above description, an embodiment is an example or implementation of the invention. The various appearances of “one embodiment”, “an embodiment” or “some embodiments” do not necessarily all refer to the same embodiments.


Although various features of the invention may be described in the context of a single embodiment, the features may also be provided separately or in any suitable combination. Conversely, although the invention may be described herein in the context of separate embodiments for clarity, the invention may also be implemented in a single embodiment.


Furthermore, it is to be understood that the invention can be carried out or practiced in various ways and that the invention can be implemented in embodiments other than the ones outlined in the description above.


The invention is not limited to those diagrams or to the corresponding descriptions. For example, flow need not move through each illustrated box or state, or in exactly the same order as illustrated and described.


Meanings of technical and scientific terms used herein are to be commonly understood as by one of ordinary skill in the art to which the invention belongs, unless otherwise defined.

Claims
  • 1. A method for real time execution of SQL queries on data stream using HWA units, said method comprising the step of: receiving data stream and injecting directly in to the one more HWA units;receiving SQL query and identifying SQL query typestatistically real time analyzing multiple data streams and calculating statistics coefficients and characteristics of data stream;creating metadata based on statistical analysis in case the calculated statistics coefficients and characteristics obey predefined rules;using created metadata for SQL execution based on SQL identified SQL type in case the calculated statistics coefficients and characteristics obey predefined rules.
  • 2. The method of claim 1 wherein the statistically real time analyzing includes at least one of: data distribution pattern in time, data points are independent probabilistically one to another, no correlation or no clustering between data units.
  • 3. The method of claim 1 wherein the creation of metadata for the data stream include one of the following: histogram, splitters or bloom filter.
  • 4. The method of claim 1 wherein the creation of metadata for the data stream for set operation includes creating hashing.
  • 5. The method of claim 1 wherein the creation of metadata for the data stream for sort operation includes applying histogram efficient Sorting.
  • 6. The method of claim 1 wherein the creation of metadata for the data stream for sort operation includes dynamically clustering data groups for sorting, wherein dynamically clustering data groups includes optimizing data elements between bins to fit onboard memory size of the HWA unit.
  • 7. The method of claim 1 wherein brute force sorting is applied on data stream queries in case data in uniformly distributed.
  • 8. The method of claim 1 wherein using the created metadata includes improving execution of the SET or sorting SQL queries in case data in not uniformly distributed.
  • 9. The method of claim 1 wherein using the created metadata for SET operation includes creating a hash function and storing temporary results of SQL queries in case data size exceeds GPU on board available memory.
  • 10. The method of claim 1 wherein using the created meta data for SET includes histogram optimization, in case the data streaming has statistical properties that allow performing efficient sorting operations.
  • 11. A system for real time execution of SQL queries on data stream using only HWA units, wherein the data stream is injected directly in to the one more HWA units, said system comprised of: a SQL analyzer module for receiving SQL query and identifying SQL query type;a statistically analyzing module implemented in the HWA unit for real time analyzing multiple data streams and calculating statistics coefficients and characteristics of data stream; andan execution module implemented in the HWA unit for creating metadata based on statistical analysis in case the calculated statistics coefficients and characteristics obey predefined rules and using the created metadata for SQL execution based on SQL identified SQL type in case the calculated statistics coefficients and characteristics obey predefined rules.
  • 12. The system of claim 11 wherein the statistically analyzing module calculates major statistics coefficients on the GPU.
  • 13. The system of claim 11 wherein the statistically analyzing identifies, in real time, statically characteristics of the data streams including at least one of: data distribution pattern in time, data points are independent probabilistically one to another, no correlation, and no clustering between data units.
  • 14. The system of claim 1 wherein the execution module for creating metadata for the data stream includes one of the following: histogram, splitters or bloom filter.
  • 15. The system of claim 11 wherein the execution module for creating metadata for the data stream for set operation creates hashing.
  • 16. The system of claim 11 wherein the execution module for creating metadata for the data stream for sort applies histogram efficient sorting.
  • 17. The system of claim 11 wherein the execution module for creating metadata for the data stream for sort operation dynamically clusters data groups for sorting, including optimizing data elements between bins to fit onboard memory size of the HWA unit.
  • 18. The system of claim 11 wherein brute force sorting is applied on data stream queries in case data in uniformly distributed.
  • 19. The system of claim 11 wherein the execution module uses the created metadata by improving execution of the SET or sorting SQL queries in case data in not uniformly distributed.
  • 20. The system of claim 11 wherein the execution module for using the created meta data for a SET operation includes creating a hash function and storing temporary results of SQL queries in case data size exceeds GPU on board available memory.
  • 21. (canceled)
PCT Information
Filing Document Filing Date Country Kind
PCT/IL2014/050297 3/18/2014 WO 00
Provisional Applications (1)
Number Date Country
61802856 Mar 2013 US