CN115438049A - Partition table historical data storage method and device and computer readable medium - Google Patents

Partition table historical data storage method and device and computer readable medium Download PDF

Info

Publication number
CN115438049A
CN115438049A CN202211286045.0A CN202211286045A CN115438049A CN 115438049 A CN115438049 A CN 115438049A CN 202211286045 A CN202211286045 A CN 202211286045A CN 115438049 A CN115438049 A CN 115438049A
Authority
CN
China
Prior art keywords
partition
data
partition table
level
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211286045.0A
Other languages
Chinese (zh)
Inventor
李伟
赵家彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202211286045.0A priority Critical patent/CN115438049A/en
Publication of CN115438049A publication Critical patent/CN115438049A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The application discloses a preservation method, a preservation device and a computer readable medium of partition table historical data, a source partition table to be subjected to data processing is obtained, data in a plurality of lower partitions divided under a preset upper partition in the source partition table are exchanged to an intermediate table, the source partition table is a multi-level partition table at least comprising a first-level partition and a second-level partition, the data in the intermediate table are exchanged to a plurality of lower partitions divided under a corresponding upper partition in a target partition table, and the target partition table is a multi-level partition table which is matched with the multi-level partition structure of the source partition table. According to the method and the device, the source partition table and the target partition table which are matched and consistent in multi-stage partition structure are established, and millisecond-level data exchange between the two tables of the source partition table and the target partition table can be completed by data transfer of the intermediate table. Meanwhile, when the data in the target partition table is queried, the detailed partition where the required data is located can be directly indexed, and the query performance of the partition table is greatly improved.

Description

Partition table historical data storage method and device and computer readable medium
Technical Field
The present application belongs to the field of database technologies, and in particular, to a method and an apparatus for storing history data of a partition table, and a computer readable medium.
Background
In recent years, with the development of business, corresponding data is explosively increased, hundreds of millions of data are generated every day, and if the ORACLE database is used for storing data, the data needs to be stored in the ORACLE database in a partition table mode for several years. However, because the amount of data to be stored in the ORACLE database is large, the amount of historical data of each partition in the partition table is also multiplied, and the efficiency of storing and backing up the historical data in the partition table is low, so that the time required for querying the data each time becomes long, that is, the query performance of the partition table in the ORACLE database is reduced.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, and a computer readable medium for storing historical data of a partition table, so as to solve the problem that the query performance of the historical data is reduced due to an excessively large amount of historical data stored in the partition table of the ORACLE database.
In order to solve the above problems, the present application provides the following scheme for storing the partition table history data:
a method for storing historical data of a partition table comprises the following steps:
acquiring a source partition table to be subjected to data processing;
exchanging data in a plurality of lower partitions divided under a preset upper partition in the source partition table to an intermediate table, wherein the source partition table is a multi-level partition table at least comprising a first-level partition and a second-level partition, and the plurality of lower partitions divided under the preset upper partition at least comprise a plurality of second-level partitions divided under the first-level partition;
and exchanging the data in the intermediate table to a plurality of subordinate partitions divided under corresponding superior partitions in a target partition table, wherein the target partition table is a multi-stage partition table which is matched with the multi-stage partition structure of the source partition table.
Optionally, the following pre-treatments are also included:
establishing a source partition table and a target partition table of a multi-level partition structure at least comprising a first-level partition and a second-level partition;
an intermediate table is established.
Optionally, the exchanging data in a plurality of lower partitions partitioned under a preset upper partition in the source partition table to an intermediate table includes:
and exchanging the physical storage space sections corresponding to a plurality of secondary partitions divided under the primary partition in the source partition table with the physical storage space sections with the corresponding sizes in the physical storage space section corresponding to the intermediate table.
Optionally:
the primary partition takes time as a primary partition key, and the secondary partition takes a preset external command segment as a partition key.
Optionally, the exchanging the data in the intermediate table to a plurality of lower partitions partitioned below the corresponding upper partition in the target partition table includes:
and exchanging the physical storage space section obtained in the intermediate table and corresponding to the data under each secondary partition in the source partition table with the physical storage space sections corresponding to a plurality of secondary partitions divided under the corresponding primary partition in the target partition table.
Optionally, the method further includes:
and responding to a data query instruction, and querying data information from the multi-level partition corresponding to the target partition table.
Optionally, the querying data information from the multi-level partition corresponding to the target partition table includes:
indexing a target secondary partition under the target primary partition in which the data information is located through the query condition;
and querying required data information from the target secondary partition.
Optionally, the method further includes:
and clearing the data in the partitions meeting the time condition in the target partition table.
A device for storing history data of a partition table, comprising:
the acquisition unit is used for acquiring a source partition table to be subjected to data processing;
the first switching unit is used for switching data in a plurality of lower partitions divided under a preset upper partition in the source partition table to an intermediate table, the source partition table is a multi-level partition table at least comprising a first-level partition and a second-level partition, and the plurality of lower partitions divided under the preset upper partition at least comprise a plurality of second-level partitions divided under the first-level partition;
and the second exchange unit is used for exchanging the data in the intermediate table to a plurality of lower-level partitions which are divided under corresponding upper-level partitions in a target partition table, and the target partition table is a multi-level partition table which is matched with the multi-level partition structure of the source partition table.
A computer readable medium having stored thereon a computer program which, when executed by a processor, is operable to implement a method of preserving partition table history data as claimed in any one of the preceding claims.
According to the scheme, the preservation method, the device and the computer readable medium for the historical data of the partition table, which are disclosed by the application, can be used for obtaining the source partition table to be subjected to data processing, exchanging data in a plurality of lower partitions which are divided under the preset upper partition in the source partition table to the intermediate table, wherein the source partition table is a multi-level partition table at least comprising a first-level partition and a second-level partition, the plurality of lower partitions which are divided under the preset upper partition at least comprise the plurality of second-level partitions which are divided under the first-level partition, exchanging data in the intermediate table to a plurality of lower partitions which are divided under the corresponding upper partition in the target partition table, and the target partition table is a multi-level partition table which is matched with the multi-level partition structure of the source partition table in a consistent manner. According to the method and the device, the source partition table and the target partition table which are matched with each other in a multi-stage partition structure are established, and the intermediate table can complete millisecond-level data exchange between the two tables. Meanwhile, when the data in the target partition table is queried, the partition where the required data is located can be directly indexed, and the query performance of the partition table is greatly improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method for storing historical data of a partition table provided in the present application;
FIG. 2 is a schematic flow chart of another method for storing historical data of a partition table provided in the present application;
FIG. 3 is a schematic flow chart of another method for storing historical data of a partition table provided in the present application;
FIG. 4 is a schematic flow chart of another method for storing historical data of a partition table provided in the present application;
FIG. 5 is a schematic diagram of data exchange between a source partition table and a historical data table provided by the present application;
fig. 6 is a configuration diagram of a partition table history data storage device according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present application are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this application are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
The application discloses a method and a device for storing historical data of a partition table and a computer readable medium.
Referring to a flowchart of a method for saving historical data of a partition table shown in fig. 1, the method for saving historical data of a partition table provided by the present application includes the following processing flows:
step 101, obtaining a source partition table to be subjected to data processing.
The ORACLE database provides the concept of a partition table for large table queries, where the partition table is logically a complete table, but physically divides the data or index of a table into relatively small, independently manageable pieces, each of which is referred to as a partition or partition index. For example, for an ORACLE data table with a large data volume, in order to improve query performance, data is stored in a partition table, the data can be partitioned according to service types or provinces, the correspondingly stored data is uniformly distributed to each partition, each partition can create a unique partition index, if data query is needed, the whole table does not need to be scanned, and query is only needed in a corresponding lowest-level partition with a small data volume (e.g., a certain secondary partition in a secondary partition structure).
The source partition table is a partition table which is established in a user-defined manner according to actual needs and can perform data processing, and the data processing which can be performed by the source partition table comprises the steps of storing new data, deleting data in partitions, copying data in the partition table to other data tables and the like.
And 102, exchanging data in a plurality of lower partitions divided under a preset upper partition in the source partition table to an intermediate table.
The source partition table may be a multi-level partition table including at least a first-level partition and a second-level partition, and the lower-level partitions partitioned under the preset upper-level partition mentioned in this step correspond to the second-level partitions partitioned under the first-level partition, respectively. Here, the source partition table may include a plurality of upper partitions and lower partitions corresponding thereto, and specifically, if an upper partition is a first-level partition, its lower partition is a second-level partition; if the upper level partition is a secondary partition, its lower level partition is a tertiary partition; if the upper level partition is a five level partition, its lower level partitions are six level partitions.
Preferably, the step of exchanging data in a plurality of lower partitions partitioned below a preset upper partition in the source partition table to the intermediate table may be performed without actually moving the data. The essential of the method is that the physical storage space sections corresponding to a plurality of secondary partitions divided under a primary partition in the source partition table and the physical storage space sections with corresponding sizes in the physical storage space sections corresponding to the intermediate table are mutually exchanged. This step is done very fast, since only the movement of the pointer is involved.
And 103, exchanging the data in the intermediate table to a plurality of lower partitions which are divided under the corresponding upper partition in the target partition table.
Similarly, the step exchanges the data in the intermediate table to a plurality of lower partitions divided under a corresponding upper partition in the target partition table by modifying the pointer corresponding to the data in each second partition in the source partition table to a corresponding position in the target partition table, that is, exchanging the physical storage space section in the intermediate table corresponding to the data in each second partition in the source partition table with the physical storage space sections corresponding to a plurality of second partitions divided under a corresponding first partition in the target partition table. Specifically, the primary partition may use time as a primary partition key, and the secondary partition may use a preset external command segment as a partition key.
It will be appreciated that the intermediate table may be a general table for providing data relay.
Illustratively, the primary partition key may be time and the secondary partition key may be a sequence number field (SEQ field). In the case that the source partition table and the target partition table are respectively of a secondary partition structure, and under the condition that primary partition and secondary partition are respectively performed based on time and SEQ fields, data of different dates can be stored in partitions respectively corresponding to different dates in the source partition table, and data of different SEQ fields under each date can be stored in corresponding SEQ sub-partitions under corresponding date partitions in the source partition table, for the source partition table, data stored on the current date such as the current date need to be transferred to the target partition table at the time of day cutting (so as to prepare for storing data on the next date such as the second day), the source partition table only needs to maintain one primary partition (namely, the partition corresponding to the current date) and maintain a plurality of SEQ sub-partitions under the one primary partition. In the case of a one-level partitioning based on date, the target partition table is a target historical partition table that includes a plurality of date partitions corresponding to different dates and a plurality of SEQ partitions corresponding to different SEQ fields under each date partition.
The preset external command segment may be, but is not limited to, a SEQ field, and may be defined by itself according to actual needs.
For example, the target historical partition table creates a partition of the previous day to save the historical data of the previous day of the source partition table, and the specific code may be as follows:
Figure BDA0003899965790000061
in summary, the preservation method for historical data of a partition table disclosed in the present application obtains a source partition table to be subjected to data processing, and exchanges data in a plurality of lower partitions partitioned under a preset upper partition in the source partition table to an intermediate table, the source partition table is a multi-level partition table at least including a first-level partition and a second-level partition, the plurality of lower partitions partitioned under the preset upper partition at least include the plurality of second-level partitions partitioned under the first-level partition, and exchanges data in the intermediate table to the plurality of lower partitions partitioned under a corresponding upper partition in a target partition table, and the target partition table is a multi-level partition table matched with the multi-level partition structure of the source partition table in a consistent manner. According to the method and the device, the source partition table and the target partition table which are matched and consistent in multi-stage partition structure are established, and millisecond-level data exchange between the two tables of the source partition table and the target partition table can be completed by data transfer of the intermediate table. Meanwhile, when the data in the target partition table is queried, the partition where the required data is located can be directly indexed, and the query performance of the partition table is greatly improved.
Optionally, in an embodiment, referring to fig. 2, the method for storing historical data of a partition table provided in the present application further includes the following preprocessing:
step 201, establishing a source partition table and a target partition table of a multi-level partition structure at least comprising a first-level partition and a second-level partition.
The created source partition table may maintain only one primary partition (i.e., the partition corresponding to the current date), and maintain a plurality of SEQ child partitions under the one primary partition, in case the data stored on the current date, e.g., the current date, needs to be transferred to the target partition table at the time of day (in order to prepare for storing the data on the next date, e.g., the next day).
Taking the above case as an example, the created source partition table may create 10 LIST partitions with the SEQ field as the partition key and the field type CHAR (2). The partition key value can be defined according to actual needs, in order to improve efficiency, the source partition table can be set to be in a logging mode, the mode can minimize the number of logs, the amount of redo logs generated can be reduced remarkably, and operation speed is increased. The information such as the main key, the index and the like is automatically created according to the requirement.
The specific codes are as follows:
Figure BDA0003899965790000071
Figure BDA0003899965790000081
and creating a target historical partition table, wherein the date is used as a primary partition, and the SEQ field is used as a secondary partition. The specific codes are as follows:
Figure BDA0003899965790000082
step 202, establishing an intermediate table.
Here, the intermediate table is established for performing the transition of the data in the source partition table and the target partition table. With reference to the example in the above step, the specific codes may be as follows:
Figure BDA0003899965790000083
Figure BDA0003899965790000091
in summary, the storage of the historical data in the source partition table into the target partition table requires that an intermediate table, and a source partition table and a target partition table of a multi-level partition structure including at least a first-level partition and a second-level partition are established first. The multi-level partition structure of the source partition table is consistent with that of the target partition table, partition keys of partitions at all levels can be defined according to actual needs, and compared with a mode of simply partitioning based on dates to realize historical data backup in the prior art, the partition structure has finer partition granularity, supports data operation with finer granularity on the partition table, such as data query in a smaller search space, and the like.
Optionally, in an embodiment, referring to fig. 3, the method for storing historical data of a partition table according to the present application further includes the following steps:
step 301, responding to a data query instruction, querying data information from the multi-level partition corresponding to the target partition table.
Specifically, when the target partition table is a secondary partition structure including a primary partition and a secondary partition, the target secondary partition under the target primary partition where the data information is located is indexed through the query condition when querying the data, that is, the query data of a certain secondary partition under a certain primary partition can be determined through the partition key value in the SQL statement filtering condition during the query, for example, the relevant data of a certain SEQ field in the previous day is queried, and the SQL statement filtering condition can be used to directly locate the secondary partition corresponding to a certain SEQ field in the primary partition corresponding to the previous day, so that the query of the large table is converted into the query of a sub-partition with a smaller data space, and the required data information can be rapidly queried in the corresponding sub-partition.
For example, when a query is performed, the query may be performed according to the sub-partitions by using the following filtering conditions, and since only data of one sub-partition is queried, the query performance is very high, and the filtering conditions are as follows:
where DATA_DATE='20220519'and SEQ='00'
in summary, in the embodiment, the lower partition to which the data belongs is further located under the upper partition to which the data belongs by using the filter condition, and the query is performed in a certain lower partition to which the data belongs, so that the query space is further reduced, and the query performance is improved.
Optionally, in an embodiment, referring to fig. 4, the method for storing historical data of a partition table according to the present application further includes the following steps:
and step 401, clearing the data in the partition meeting the time condition in the target partition table.
Specifically, the data in the target partition table also needs to be cleaned regularly to ensure high performance of data query, where the time condition may be a condition defined according to actual requirements and related to time, for example, if data in a history period needs to be cleaned as expired data according to a period of three months, one month, one week, or one day, the time condition may be set as: the date corresponding to the partition data is earlier than the date corresponding to three months/one month/one week/one day before the present day.
Based on the set time condition, when partition data meeting the time condition appears in the partition table, a clearing (DROP) process for the partition data is triggered, so that index information corresponding to the partition where the expired data in the target historical partition table is located is invalid, and the operation running time is in millisecond level. Illustratively, the specific codes are as follows:
Figure BDA0003899965790000101
in summary, according to the embodiment, by clearing the data in the partition table meeting the time condition in the target partition table, the expired data in the target historical partition table can be cleared in time, and the timeliness of the data in the target partition table is ensured.
Optionally, referring to fig. 5, a schematic diagram of data exchange between the source partition table and the historical data table according to the present application is further provided.
Specifically, the source partition table swaps the partition data of the previous day to the intermediate table, and the intermediate table swaps the data to the SEQ child partition under the previous day partition of the destination history data table, which is equivalent to storing the data of the previous day of the source partition in the destination history data table. The specific code may be as follows:
Figure BDA0003899965790000111
for the above method for saving the historical data of the partition table, the present application also provides a device for saving the historical data of the partition table, and the composition of the device is shown in fig. 5.
The acquiring unit 10 is configured to acquire a source partition table to be subjected to data processing.
The first switching unit 20 is configured to switch data in a plurality of lower partitions partitioned under a preset upper partition in a source partition table to an intermediate table, where the source partition table is a multi-level partition table at least including a first-level partition and a second-level partition, and the plurality of lower partitions partitioned under the preset upper partition at least include the plurality of second-level partitions partitioned under the first-level partition.
And the second exchange unit 30 is configured to exchange the data in the intermediate table to a plurality of lower partitions partitioned under corresponding upper partitions in a target partition table, where the target partition table is a multi-level partition table matched with the multi-level partition structure of the source partition table.
In one embodiment, the apparatus further comprises:
the system comprises a preprocessing unit, a data processing unit and a data processing unit, wherein the preprocessing unit is used for establishing a source partition table and a target distribution table of a multi-level partition structure at least comprising a first-level partition and a second-level partition.
An intermediate table is established.
In an embodiment, the first switching unit 20 is specifically configured to:
and exchanging the physical storage space sections corresponding to a plurality of secondary partitions divided under the primary partition in the source partition table with the physical storage space sections with the corresponding sizes in the physical storage space section corresponding to the intermediate table.
The primary partition takes time as a primary partition key, and the secondary partition takes a preset external command segment as a partition key.
In an embodiment, the second switching unit 30 is specifically configured to:
and exchanging the physical storage space section obtained in the intermediate table and corresponding to the data under each secondary partition in the source partition table with the physical storage space sections corresponding to a plurality of secondary partitions divided under the corresponding primary partition in the target partition table.
In one embodiment, the apparatus further comprises:
and the data query unit is specifically used for responding to the data query instruction and querying data information from the multi-level partition corresponding to the target partition table.
And indexing a target secondary partition under the target primary partition in which the data information is located through the query condition.
And querying required data information from the target secondary partition.
In one embodiment, the apparatus further comprises:
and the data clearing unit is specifically used for clearing data in the partition meeting the time condition in the target partition table.
In addition, a computer readable medium is provided, on which a computer program is stored, where the computer program, when executed by a processor, can be used to implement each processing flow in the method for saving partition table history data.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
For convenience of description, the above system or apparatus is described as being divided into various modules or units by function, respectively. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
Finally, it is further noted that, herein, relational terms such as first, second, third, fourth, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for storing historical data of a partition table is characterized by comprising the following steps:
acquiring a source partition table to be subjected to data processing;
exchanging data in a plurality of lower partitions divided under a preset upper partition in the source partition table to an intermediate table, wherein the source partition table is a multi-level partition table at least comprising a first-level partition and a second-level partition, and the plurality of lower partitions divided under the preset upper partition at least comprise a plurality of second-level partitions divided under the first-level partition;
and exchanging the data in the intermediate table to a plurality of lower-level partitions which are partitioned under corresponding upper-level partitions in a target partition table, wherein the target partition table is a multi-level partition table which is matched with the multi-level partition structure of the source partition table.
2. The method of claim 1, further comprising the following pre-processing:
establishing a source partition table and a target partition table of a multi-level partition structure at least comprising a first-level partition and a second-level partition;
and establishing an intermediate table.
3. The method according to claim 1, wherein the swapping data in a plurality of lower partitions partitioned below a preset upper partition in the source partition table to an intermediate table comprises:
and exchanging the physical storage space sections corresponding to a plurality of secondary partitions divided under the primary partition in the source partition table with the physical storage space sections with the corresponding sizes in the physical storage space section corresponding to the intermediate table.
4. The method of claim 1, wherein the primary partition is keyed by time and the secondary partition is keyed by a preset external command segment.
5. The method of claim 1, wherein the swapping data in the intermediate table to a plurality of lower partitions partitioned below a corresponding upper partition in a target partition table comprises:
and exchanging the physical storage space section obtained in the intermediate table and corresponding to the data under each secondary partition in the source partition table with the physical storage space sections corresponding to a plurality of secondary partitions under the corresponding primary partition in the target partition table.
6. The method of claim 1, further comprising:
and responding to a data query instruction, and querying data information from the multi-level partition corresponding to the target partition table.
7. The method according to claim 6, wherein the querying data information from the multi-level partition corresponding to the target partition table comprises:
indexing a target secondary partition under the target primary partition in which the data information is located through the query condition;
and querying required data information from the target secondary partition.
8. The method of claim 4, further comprising:
and clearing the data in the partitions meeting the time condition in the target partition table.
9. A device for storing history data of a partition table, comprising:
the acquisition unit is used for acquiring a source partition table to be subjected to data processing;
the first switching unit is used for switching data in a plurality of lower partitions divided under a preset upper partition in the source partition table to an intermediate table, the source partition table is a multi-stage partition table at least comprising a first-stage partition and a second-stage partition, and the plurality of lower partitions divided under the preset upper partition at least comprise a plurality of second-stage partitions divided under the first-stage partition;
and the second exchange unit is used for exchanging the data in the intermediate table to a plurality of subordinate partitions which are divided under corresponding superior partitions in a target partition table, and the target partition table is a multi-stage partition table which is matched with the multi-stage partition structure of the source partition table.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, is operative to carry out the method of saving partition table history data according to any one of claims 1 to 8.
CN202211286045.0A 2022-10-20 2022-10-20 Partition table historical data storage method and device and computer readable medium Pending CN115438049A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211286045.0A CN115438049A (en) 2022-10-20 2022-10-20 Partition table historical data storage method and device and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211286045.0A CN115438049A (en) 2022-10-20 2022-10-20 Partition table historical data storage method and device and computer readable medium

Publications (1)

Publication Number Publication Date
CN115438049A true CN115438049A (en) 2022-12-06

Family

ID=84252103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211286045.0A Pending CN115438049A (en) 2022-10-20 2022-10-20 Partition table historical data storage method and device and computer readable medium

Country Status (1)

Country Link
CN (1) CN115438049A (en)

Similar Documents

Publication Publication Date Title
CN101651576B (en) Alarm information processing method and system
US7562090B2 (en) System and method for automating data partitioning in a parallel database
Olken et al. Random sampling from databases: a survey
EP0434586A2 (en) Attribute-based method and apparatus of classification and retrieval
US20130212131A1 (en) Symbolic hyper-graph database
CN100578498C (en) Data integral service system and method
CN109710618A (en) The mixing storage method and system of knowledge mapping data relationship separation
US20100299324A1 (en) Information service for facts extracted from differing sources on a wide area network
WO1992021090A1 (en) Relational data base memory utilization analyzer
CN102810094A (en) Report generation method and device
Luo et al. Efficient similarity joins on massive high-dimensional datasets using mapreduce
CN102779138A (en) Hard disk access method of real time data
US20170270149A1 (en) Database systems with re-ordered replicas and methods of accessing and backing up databases
Fotouhi et al. Optimal secondary storage access sequence for performing relational join
CN115438049A (en) Partition table historical data storage method and device and computer readable medium
Hilderman et al. Principles for mining summaries using objective measures of interestingness
CN111881323B (en) Table separation method based on sequencing field and time routing
Michelena et al. A network reliability approach to optimal decomposition of design problems
CN105868406A (en) Multi-database based patent retrieval system
Ferro et al. An efficient duplicate record detection using q-grams array inverted index
JPH0934906A (en) Book management device
CN110263028B (en) Full-scale synchronization method applied to search service
CN115510088A (en) Method and device for improving retrieval convenience
Bagga et al. D-Apriori: An Algorithm to Incorporate Dynamism in Apriori Algorithm
Dobreva et al. Get tracked: A triple store for rfid traceability data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination