A query processing system, comprising: a host central processing unit, CPU, configured to execute a database management system, DBMS,; and a database accelerator separate from the host CPU, wherein the database accelerator comprises a plurality of processing units, PUs,, wherein the DBMS comprises an accelerator library and is configured to: receive a query to execute on a database; retrieve a database table from the database corresponding to the query; reformat the database table comprising rows and columns into a data block, wherein the data block comprises a plurality of PU data blocks, each corresponding to one of the plurality of PUs, wherein each of the plurality of PU data blocks comprises a portion of data stored in the rows and columns of the database table, wherein reformatting the database table comprises using an enqueue compute function from the accelerator library for converting the data received from the databases into a format that can be processed in parallel by the database accelerator; transmit the data block to the database accelerator, wherein the database accelerator is configured to: process the plurality of PU data blocks using the plurality of PUs in parallel; and forward results from the plurality of PUs to the DBMS; wherein each of the PUs has a respective memory element for storing the PU data blocks; wherein the DBMS is configured to add headers to each of the plurality of PU data blocks indicating a number of rows of data in each of the plurality of PU data blocks; wherein the DBMS is configured to update row indicators in the headers to indicate the amount of data in the respective PU data block when the plurality of PU data blocks have different amount of data. a host central processing unit, CPU, configured to execute a database management system, DBMS,; and a database accelerator separate from the host CPU, wherein the database accelerator comprises a plurality of processing units, PUs,, wherein the DBMS comprises an accelerator library and is configured to: receive a query to execute on a database; retrieve a database table from the database corresponding to the query; reformat the database table comprising rows and columns into a data block, wherein the data block comprises a plurality of PU data blocks, each corresponding to one of the plurality of PUs, wherein each of the plurality of PU data blocks comprises a portion of data stored in the rows and columns of the database table, wherein reformatting the database table comprises using an enqueue compute function from the accelerator library for converting the data received from the databases into a format that can be processed in parallel by the database accelerator; transmit the data block to the database accelerator, receive a query to execute on a database; retrieve a database table from the database corresponding to the query; reformat the database table comprising rows and columns into a data block, wherein the data block comprises a plurality of PU data blocks, each corresponding to one of the plurality of PUs, wherein each of the plurality of PU data blocks comprises a portion of data stored in the rows and columns of the database table, wherein reformatting the database table comprises using an enqueue compute function from the accelerator library for converting the data received from the databases into a format that can be processed in parallel by the database accelerator; transmit the data block to the database accelerator, wherein the database accelerator is configured to: process the plurality of PU data blocks using the plurality of PUs in parallel; and forward results from the plurality of PUs to the DBMS; wherein each of the PUs has a respective memory element for storing the PU data blocks; process the plurality of PU data blocks using the plurality of PUs in parallel; and forward results from the plurality of PUs to the DBMS; wherein each of the PUs has a respective memory element for storing the PU data blocks; wherein the DBMS is configured to add headers to each of the plurality of PU data blocks indicating a number of rows of data in each of the plurality of PU data blocks; wherein the DBMS is configured to update row indicators in the headers to indicate the amount of data in the respective PU data block when the plurality of PU data blocks have different amount of data.