| CPC G06F 16/90335 (2019.01) | 20 Claims |

|
1. A computer-implemented method for executing database queries, the computer-implemented method comprising:
receiving, by a database system, a database query for processing data stored in one or more input tables;
generating an execution plan for executing the database query, the execution plan comprising a plurality of operators, wherein at least an operator receives data output by another operator or generates output provided as input to another operator;
allocating a set of threads for executing operators of the execution plan, each thread processing one or more operators, the set of threads comprising at least a first thread executing a first operator and a second thread executing a second operator, wherein the first thread communicates with the second thread via a blocking channel, the blocking channel comprising a buffer of fixed capacity for storing data; and
processing the database query by streaming data through the operators of the execution plan, wherein the first thread provides output of the first operator to the second operator of the second thread via the blocking channel, the processing comprising:
sending, by the first thread, data generated by the first operator to the second thread executing the second operator via the blocking channel if the buffer of the blocking channel has available capacity to store the data, and
blocking execution of the first thread if the buffer of the blocking channel is full, wherein execution of the first thread is blocked until the buffer of the blocking channel has capacity to store the data generated by the first operator.
|