Systems and methods for processing database queries via a computational storage device
Systems and methods for processing a database query from a device are disclosed. A first command is received in response to the database query. In response to the first command, a storage device is signaled for scanning data in a database object. The signaling of the storage device may include: transmitting a second command for configuring the storage device based on the database query; transmitting a third command for executing a scan of the data in the database object; and transmitting a fourth command for reading an output of the scan, wherein the output is responsive to the database query.
1 . A method for processing a database query from a device, the method comprising:
loading one or more programs to a first processor of a computational storage device;
receiving, by a database management system (DBMS) of a computing device having a second processor, a first database query associated with a first database object;
identifying, by the DBMS, a first type of data associated with the first database object; and
in response to identifying the first type of data:
identifying an address of the computational storage device storing the first database object;
based on identifying the address of the computational storage device storing the first database object:
transmitting by a device driver of the computing device a first command to the one or more programs for configuring the computational storage device based on the first database query;
transmitting by the device driver a second command to the one or more programs, wherein the first processor of the computational storage device executes the one or more programs and scans a first data in the first database object based on the second command and generates an output of the scan; and
transmitting by the device driver a third command for reading the output of the scan, wherein the output is responsive to the database query.
2 . The method of claim 1 further comprising:
providing the output to a client.
3 . The method of claim 1 , wherein the configuring of the computational storage device includes allocating a region of a second memory of the computational storage device for use for the scan of the data.
4 . The method of claim 3 further comprising:
identifying a physical address associated with the first database object; and
transmitting a fourth command to the computational storage device for retrieving data from the physical address, into the region of the second memory.
5 . The method of claim 4 , wherein the first database object is a file, wherein the identifying the physical address includes identifying the physical address mapped to the file.
6 . The method of claim 3 , wherein the output is stored in the region of the second memory.
7 . The method of claim 1 further comprising receiving a request from a gateway to process the first database query by the computational storage device, wherein the request is based on a status of the computational storage device.
8 . The method of claim 7 , wherein the gateway is configured to select the computational storage device based on the status.
9 . A system for processing a database query from a client, the system comprising:
a first computational storage device having a first processing circuit;
a second computational storage device having a second processing circuit;
a processor; and
a memory, wherein the memory stores instructions that, when executed by the processor, cause the processor to:
load one or more programs onto the first processing circuit of the first computational storage device;
provide to a database managing system (DBMS) a first database query associated with a first database object;
identify, via the DBMS, a first type of data associated with the first database object; and
in response to identifying the first type of data:
identify an address of a selected computational storage device from the first computational storage device and the second computational storage device storing the first database object;
based on identifying the selected computational storage device storing the first database object:
transmit by a device driver a first command to the one or more programs for configuring the selected computational storage device based on the database query;
transmit by the device driver a second command to the one or more programs, wherein a corresponding processing circuit of the selected computational storage device is designed to execute the one or more programs and scan a first data in the first database object based on the second command and generate an output of the scan; and
transmit by the device driver a third command for reading the output of the scan, wherein the output is responsive to the database query.
10 . The system of claim 9 , wherein the instructions further cause the processor to:
provide the output to the client.
11 . The system of claim 9 , wherein the configuring of the selected computational storage device includes allocating a region of a second memory of the selected computational storage device for use for the scan of the data.
12 . The system of claim 11 , wherein the output is stored in the region of the second memory.
13 . The system of claim 9 , wherein the instructions further cause the processor to:
identify a physical address associated with the first database object; and
transmit a fourth command to the selected computational storage device for retrieving data from the physical address, into a region of a second memory.
14 . The system of claim 13 , wherein the first database object is a file, wherein the identifying the physical address includes identifying the physical address mapped to the file.
15 . The system of claim 9 further comprising a gateway configured to generate a request to process the first database query by the selected computational storage device, wherein the request is based on a status of the selected computational storage device.
16 . The system of claim 15 , wherein the gateway is configured to select the selected computational storage device based on the status.