This application discloses a
data query method, apparatus, electronic device, and computer-readable medium, relating to the field of
big data processing technology. The method includes: receiving a
data query request and obtaining a corresponding time identifier and
database identifier; determining the corresponding number of partitions based on the
database identifier, and then performing
modulo operation based on the time identifier and the number of partitions to obtain a query partition identifier; responding to a change in the time identifier, determining a first historical partition from the historical partitions corresponding to the number of partitions and determining a second historical partition corresponding to the query partition identifier, and
copying statistical information corresponding to the first historical partition to the second historical partition; generating a
query statement based on the query partition identifier, accessing the second historical partition after
copying the statistical information, and then executing the
query statement to return query results. This achieves optimal query efficiency while improving the accuracy of data queries.