A method for querying data in a database, wherein the database runs in a computer system comprising a central processing unit, CPU and a graphics processing unit, GPU, and the method comprises: receiving a query instruction, wherein the query instruction comprises one or more query conditions; determining a state of each block index comprised in a block index set prestored in a global memory of the GPU, wherein each block index indicates aggregate values of original data from a plurality of rows in the database, the aggregate values comprising a maximum value and a minimum value, the block index set comprises at least one block index for each column in the database, and the block index set is generated by the CPU and is stored into the global memory of the GPU such that the block indexes in the block index set are stored continuously; and when each block index in the global memory of the GPU is in an asynchronous state, such that no synchronization operation is being performed between the block index stored in the global memory of the GPU and the block index of a block index set, starting one or more GPU processes to filter the block index in the global memory of the GPU according to the one or more query conditions, to obtain a first block index query result including a block index having aggregate values meeting one or more of the query conditions; and determining a final data query result according to the first block index query result, the final data query result comprising the original data aggregated in the block index indicated by the first block index query result; wherein determining a state of each block index comprises: determining whether a synchronization operation is being performed on the block index, the synchronization operation comprising updating the original data then synchronizing the block index with the original data. receiving a query instruction, wherein the query instruction comprises one or more query conditions; determining a state of each block index comprised in a block index set prestored in a global memory of the GPU, wherein each block index indicates aggregate values of original data from a plurality of rows in the database, the aggregate values comprising a maximum value and a minimum value, the block index set comprises at least one block index for each column in the database, and the block index set is generated by the CPU and is stored into the global memory of the GPU such that the block indexes in the block index set are stored continuously; and when each block index in the global memory of the GPU is in an asynchronous state, such that no synchronization operation is being performed between the block index stored in the global memory of the GPU and the block index of a block index set, starting one or more GPU processes to filter the block index in the global memory of the GPU according to the one or more query conditions, to obtain a first block index query result including a block index having aggregate values meeting one or more of the query conditions; and determining a final data query result according to the first block index query result, the final data query result comprising the original data aggregated in the block index indicated by the first block index query result; wherein determining a state of each block index comprises: determining whether a synchronization operation is being performed on the block index, the synchronization operation comprising updating the original data then synchronizing the block index with the original data.