Search

CN-117009440-B - Paging query method, device and server of OLAP database

CN117009440BCN 117009440 BCN117009440 BCN 117009440BCN-117009440-B

Abstract

The invention discloses a paging query method, a paging query device and a paging query server of an OLAP database, and relates to the technical field of databases, wherein the method comprises the steps that the server acquires an interface paging query request corresponding to a query data set sent by client equipment; the method comprises the steps of determining a paging inquiry file piece corresponding to an interface paging inquiry request in a stored target file piece, wherein the paging inquiry file piece comprises one or two target file pieces, inquiring from the paging inquiry file piece to obtain paging data corresponding to the interface paging inquiry request, and sending the paging data to client equipment to enable the client equipment to display the paging data.

Inventors

  • ZHANG KAI
  • XIAO JUN

Assignees

  • 上海微盟企业发展有限公司

Dates

Publication Date
20260508
Application Date
20230602

Claims (8)

  1. 1. A method for paging query of an OLAP database, comprising: The method comprises the steps that a server obtains an interface paging query request corresponding to a query data set sent by client equipment, wherein the query data set is a data set corresponding to a target data query request in an OLAP database, and the target data query request is a data query request corresponding to the interface paging query request; determining a paging inquiry file piece corresponding to the interface paging inquiry request in stored target file pieces, wherein each target file piece stores data in the inquiry data set with the data quantity smaller than or equal to a preset data quantity, and the paging inquiry file piece comprises one or two target file pieces; inquiring from the paging inquiry file sheet to obtain paging data corresponding to the interface paging inquiry request; Sending the paging data to the client device so that the client device displays the paging data; the determining the paging inquiry file piece corresponding to the interface paging inquiry request in the stored target file piece comprises the following steps: Determining the offset range of the query data set according to the page size and the request page in the interface paging query request, wherein if the remainder of dividing the data volume of the query data set by the preset data volume is 0, the number of the target file pieces is the quotient of dividing the data volume of the query data set by the preset data volume, and if the remainder of dividing the data volume of the query data set by the preset data volume is not 0, the number of the target file pieces is the quotient of dividing the data volume of the query data set by the preset data volume plus 1; Determining the number identification of the paging inquiry file piece and the paging offset range according to the offset range and the preset data quantity, wherein the preset data quantity is integral multiple of the page size, and the paging inquiry file piece comprises a target file piece; And determining the data corresponding to the paging offset range in the paging inquiry file sheet as the paging data.
  2. 2. The OLAP database paging query method of claim 1, wherein the number is identified as a quotient of a minimum of the offset range divided by the preset data amount plus 1, and the paging offset range is a remainder of the minimum of the offset range divided by the preset data amount to a remainder of the maximum of the offset range divided by the preset data amount.
  3. 3. The method for paging query of OLAP database according to claim 1, wherein the step of querying from the page query file slice to obtain the page data corresponding to the interface page query request includes: judging whether the content of the paging inquiry file piece is stored in a cache of the server or not; if yes, inquiring from the cached content of the paging inquiry file piece to obtain the paging data; If not, inquiring from the paging inquiry file piece stored in a disk storage or a cloud to obtain the paging data, and storing the content of the paging inquiry file piece into the cache, wherein the target file piece is stored in the disk of the server and/or the cloud.
  4. 4. The OLAP database paging query method of claim 1, further comprising: And deleting the target file piece stored in the local disk after the non-queried time of the target file piece reaches the preset cleaning time.
  5. 5. The OLAP database paging query method of any one of claims 1 to 4, wherein before the server obtains the interface paging query request corresponding to the query data set sent by the client device, the method further comprises: The server acquires the target data query request sent by the client device; inquiring from the OLAP database to obtain an inquiry data set corresponding to the target data inquiry request; Dividing the query data set according to the preset data volume to obtain the target file piece; and carrying out local disk storage and/or cloud storage on the target file.
  6. 6. The method for paging query of OLAP database according to claim 5, wherein said querying from the OLAP database to obtain the query dataset corresponding to the target data query request includes: The query data set is read from the OLAP database in a streaming manner.
  7. 7. A paging query device for an OLAP database, applied to a server, comprising: the system comprises a paging acquisition module, a paging processing module and a client device, wherein the paging acquisition module is used for acquiring an interface paging query request corresponding to a query data set sent by the client device, the query data set is a data set corresponding to a target data query request in an OLAP database, and the target data query request is a data query request corresponding to the interface paging query request; The file determining module is used for determining paging inquiry file slices corresponding to the interface paging inquiry requests in stored target file slices, wherein each target file slice stores data in the inquiry data set with the data volume smaller than or equal to a preset data volume, and the paging inquiry file slices comprise one or two target file slices; The data query module is used for querying from the paging query file sheet to obtain paging data corresponding to the interface paging query request; the data sending module is used for sending the paging data to the client device so that the client device can display the paging data; wherein, the file determining module includes: A data offset determining submodule, configured to determine an offset range of the query data set according to a page size and a request page in the interface paging query request, where if a remainder of dividing the data volume of the query data set by the preset data volume is 0, the number of the target file pieces is a quotient of dividing the data volume of the query data set by the preset data volume, and if a remainder of dividing the data volume of the query data set by the preset data volume is not 0, the number of the target file pieces is a quotient of dividing the data volume of the query data set by the preset data volume plus 1; The paging offset determining submodule is used for determining the number identification of the paging inquiry file piece and the paging offset range according to the offset range and the preset data quantity, wherein the preset data quantity is integral multiple of the page size, and the paging inquiry file piece comprises a target file piece; and the paging data sub-module is used for determining the data corresponding to the paging offset range in the paging inquiry file sheet as the paging data.
  8. 8. A server for a server, which comprises a server and a server, characterized by comprising the following steps: A memory for storing a computer program; A processor for implementing the steps of the paging query method of OLAP database according to any one of claims 1 to 6 when executing the computer program.

Description

Paging query method, device and server of OLAP database Technical Field The present invention relates to the field of database technologies, and in particular, to a paging query method, device and server for an OLAP database. Background Currently, the paging implementation of OLAP (On LINE ANALYTIC Processlng, online analysis processing) databases is implemented using the usual offset scheme of existing databases. For example, there is a data table with data size of 100 ten thousand, if each page of the interface displays 10 data, the maximum page number (e.g. N in fig. 1) is 10 ten thousand, when the user wants to view the data of the last page, by sending corresponding SQL (Structured Query Language ) to the database, for example, "select from table limit 999990,10", the database will read all the data, then discard the preceding 999990 data, and return the remaining 10 results, so that with this paging method, the page number to be viewed is more later, the paging query pressure is more, and because OLAP database is mostly distributed stored, the cost of the database performance will increase with the cost of the partition number. Therefore, how to reduce the consumption of the database performance by the paging query of the OLAP database and increase the paging query rate is an urgent problem to be solved nowadays. Disclosure of Invention The invention aims to provide a paging query method, device and server for an OLAP database, which are used for improving the paging query rate by consuming the performance of the database by the paging query of the OLAP database. In order to solve the above technical problems, the present invention provides a paging query method for an OLAP database, including: The method comprises the steps that a server obtains an interface paging query request corresponding to a query data set sent by client equipment, wherein the query data set is a data set corresponding to a target data query request in an OLAP database, and the target data query request is a data query request corresponding to the interface paging query request; determining a paging inquiry file piece corresponding to the interface paging inquiry request in stored target file pieces, wherein each target file piece stores data in the inquiry data set with the data quantity smaller than or equal to a preset data quantity, and the paging inquiry file piece comprises one or two target file pieces; inquiring from the paging inquiry file sheet to obtain paging data corresponding to the interface paging inquiry request; and sending the paging data to the client device so that the client device displays the paging data. In some embodiments, the determining the paging query file piece corresponding to the interface paging query request in the stored target file piece includes: Determining the offset range of the query data set according to the page size and the request page in the interface paging query request, wherein if the remainder of dividing the data volume of the query data set by the preset data volume is 0, the number of the target file pieces is the quotient of dividing the data volume of the query data set by the preset data volume, and if the remainder of dividing the data volume of the query data set by the preset data volume is not 0, the number of the target file pieces is the quotient of dividing the data volume of the query data set by the preset data volume plus 1; determining a paging offset range of the paging inquiry file piece according to the offset range and the preset data quantity; And determining the data corresponding to the paging offset range in the paging inquiry file sheet as the paging data. In some embodiments, the determining the page offset range of the page query file slice according to the offset range and the preset data amount includes: And determining the number identification of the paging inquiry file piece and the paging offset range according to the offset range and the preset data quantity, wherein the preset data quantity is integral multiple of the page size, and the paging inquiry file piece comprises a target file piece. In some embodiments, the number identifies a quotient of a minimum of the offset range divided by the preset data amount plus 1, and the page offset range is a remainder of the minimum of the offset range divided by the preset data amount to a remainder of a maximum of the offset range divided by the preset data amount. In some embodiments, the querying from the paging query file slice to obtain the paging data corresponding to the interface paging query request includes: judging whether the content of the paging inquiry file piece is stored in a cache of the server or not; if yes, inquiring from the cached content of the paging inquiry file piece to obtain the paging data; If not, inquiring from the paging inquiry file piece stored in a disk storage or a cloud to obtain the paging data, and storing the content of the paging inquiry file piece into the