CN109299101A - Data retrieval method, device, server and storage medium - Google Patents
Data retrieval method, device, server and storage medium Download PDFInfo
- Publication number
- CN109299101A CN109299101A CN201811196264.3A CN201811196264A CN109299101A CN 109299101 A CN109299101 A CN 109299101A CN 201811196264 A CN201811196264 A CN 201811196264A CN 109299101 A CN109299101 A CN 109299101A
- Authority
- CN
- China
- Prior art keywords
- data
- subregion
- data retrieval
- retrieved
- condition
- 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.)
- Granted
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of data retrieval method, device, server and storage mediums, obtain data retrieval condition;Determine that subregion to be retrieved, subregion to be retrieved are the subregion that partition characteristics and data retrieval condition have intersection;Determine data research result, data research result is the data acquisition system for meeting data retrieval condition in subregion to be retrieved, after according to data retrieval condition and the determining retrieval subregion of partition characteristics, data research result is determined further according to data retrieval condition in retrieval subregion, it solves the problems, such as in the prior art each data in subregion to be retrieved to be required to match with search condition, the time cost for reducing data retrieval is realized, search efficiency is improved.
Description
Technical field
The present embodiments relate to big data technology more particularly to a kind of data retrieval method, device, server and storages
Medium.
Background technique
With database information system application field it is continuous expansion and application time constantly increase, data volume sharply on
Rise.It is widely used in the information system of database to promote inquiry and operating efficiency, the partition table of big table, Sybase
Management system supports partition table.
Partition table by by the mass data in one big table according to the rule that user specifies split into different subregions into
Row storage and management greatly improve the operation to table and search efficiency.The retrieval mode different to partition table, still results in
A great difference of search efficiency.
In general, different according to the search condition of partition table, to the retrieval mode of partition table can all differences, table 1 is
The corresponding relationship of search condition and retrieval mode, as shown in table 1 below.
Table 1
From table 1 it follows that other modes can pass through inspection in addition to full area search needs to scan all subregions
The range of rope condition reduces the number of retrieval subregion, improves search efficiency.
But although range retrieval mode can reduce the number of scanning subregion, for subregion to be retrieved, to wherein
Each data be required to carry out search condition comparison, in the biggish situation of partition data amount, retrieval time is long, speed
Slowly, very big to the influence of query performance.
Summary of the invention
The present invention provides a kind of data retrieval method, device, server and storage medium, solves and treats in the prior art
Each data of retrieval subregion is required to the problem of matching with search condition.
In a first aspect, the embodiment of the invention provides a kind of data retrieval methods, comprising:
Obtain data retrieval condition;
Determine that subregion to be retrieved, the subregion to be retrieved are point that partition characteristics and the data retrieval condition have intersection
Area;
Determine that data research result, the data research result are to meet the data retrieval item in the subregion to be retrieved
The data acquisition system of part.
Second aspect, the embodiment of the invention also provides a kind of data searchers, comprising:
Module is obtained, for obtaining data retrieval condition;
First determining module, for determining that subregion to be retrieved, the subregion to be retrieved are that partition characteristics and the data are examined
Rope condition has the subregion of intersection;
Second determining module, for determining that data research result, the data research result are in the subregion to be retrieved
Meet the data acquisition system of the data retrieval condition.
The third aspect, the embodiment of the invention also provides a kind of server, the server includes:
One or more processors;
Memory, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes the data retrieval method as described in first aspect.
Fourth aspect, it is described the embodiment of the invention also provides a kind of storage medium comprising computer executable instructions
Computer executable instructions as computer processor when being executed for executing the data retrieval method as described in first aspect.
Data retrieval method, device, server and storage medium provided by the above embodiment obtain data retrieval condition;
Determine that subregion to be retrieved, subregion to be retrieved are the subregion that partition characteristics and data retrieval condition have intersection;Determine data retrieval knot
Fruit, data research result is the data acquisition system for meeting data retrieval condition in subregion to be retrieved, by according to data retrieval condition
After determining subregion to be retrieved with partition characteristics, data retrieval knot is determined further according to data retrieval condition in subregion to be retrieved
Fruit solves the problems, such as to be required to match with search condition to each data in subregion to be retrieved in the prior art, realizes
The time cost of data retrieval is reduced, search efficiency is improved.
Detailed description of the invention
Fig. 1 is the flow chart for the data retrieval method that the embodiment of the present invention one provides;
Fig. 2 is the flow chart of data retrieval method provided by Embodiment 2 of the present invention;
Fig. 3 is the flow chart for the data retrieval method that the embodiment of the present invention three provides;
Fig. 4 is the structural schematic diagram for the data searcher that the embodiment of the present invention four provides;
Fig. 5 is a kind of structural schematic diagram for server that the embodiment of the present invention five provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is the flow chart for the data retrieval method that the embodiment of the present invention one provides, and the present embodiment is applicable to retrieval point
The case where area's table data, this method can be executed by data searcher.
In the present embodiment, database is to be long-term stored at interior, organized, the sharable data acquisition system of computer.Table
It is the basic unit that data store in database, is the logic entity that data are manipulated.Table is made of columns and rows, every a line
Represent an individually record.Comprising one group of fixed column in table, column are also referred to as field.Table subregion common at present is horizontal point
Area is to be stored in the data line in table in different subregions according to specified rule, and divisional type includes range partition, list point
Area and hash partition three types.In order to facilitate understanding, the present embodiment first simply introduces the concept of these three subregions.
Range partition refers to that the ranges to one or more column in table carry out subregions, the range according to locating for train value, certainly
It is fixed which subregion is the data is stored on.Such as according to serial number subregion, subregion etc. is carried out according to the date created of business record.
Illustratively, create table t1 (c1 int, c2 int) partition by range (c1)
(partition p1 values less than (10),
partition p2 values less than(20));
Range partition table t1 is created, subregion is classified as c1, includes two subregions p1, p2.Wherein p1 range are as follows: c1 < 10;It is all
The data of c1 < 10 are stored in p1 subregion, and c1 < 10 are the partition characteristics of p1 subregion.P2 range are as follows: 10≤c1 < 20;All 10≤c1
< 20 data are stored in p2 subregion.10≤c1 < 20 are the partition characteristics of p2 subregion.It should be noted that between adjacent sectors
The data area of partition characteristics is continuous.
Hash partition is uniformly distributed according to the cryptographic Hash of train value, realizes the data that each subregion is hashed as much as possible
It is equal.
Illustratively, create table t2 (c3 int, c4 int) partition by hash (c3)
(partition p3,partition p4);
Hash partition table t2 is created, subregion is classified as c3, includes two subregions p3, p4.The Kazakhstan that data pass through data store internal
A cryptographic Hash, cryptographic Hash and number of partitions modulus is calculated in uncommon function, obtains affiliated subregion.
List partition refer to clearly specify according to certain column some occurrence carry out subregion, rather than as range partition that
What sample was divided according to the value range of column.Such as: subregion is carried out according to position, color.
It is illustrative: create table t3 (c5 varchar (10), c6 int) partition by list (c5)
(partition p5 values (' Shanghai ', ' Beijing '),
Partition p6 values (' Guangzhou ', ' Shenzhen ');
List partition table t3 is created, subregion is classified as c5, includes two subregions p5, p6.Wherein all data in p5 subregion
C5 subregion column are that ' Shanghai ' perhaps the c5 subregion column of all data are ' Guangzhou ' or ' Shenzhen ' in ' Beijing ' p6 subregion.
C5 be ' Shanghai ' perhaps ' Beijing ' be p5 subregion partition characteristics c5 be ' Guangzhou ' or ' Shenzhen ' be p6 subregion subregion it is special
Sign.
Specifically, as shown in Figure 1, data retrieval method provided in an embodiment of the present invention, mainly includes the following steps:
S110, data retrieval condition is obtained.
In the present embodiment, data retrieval condition refers to the relevant information for the data that user needs to obtain.Preferably, data
Search condition can be single number or a data area or multiple data areas or single discrete magnitude or
Multiple discrete magnitudes etc..Illustratively, data retrieval condition may is that x < 20, be also possible to x=20, can also be that x is Guangzhou
Portfolio etc..Wherein, specific data retrieval condition can be set according to the actual conditions of partition table.It is only in the present embodiment
Data search condition is illustrated, and it is non-limiting.
Further, in the present embodiment, the acquisition modes of data retrieval condition may be set according to actual conditions.Example
Such as: when setting receives the data retrieval sentence of external device transmission, to above-mentioned retrieval sentence into parsing, by data retrieval sentence
Resolve to the data retrieval condition that database can identify.Wherein, external device includes but is not limited to: computer, intelligent hand
Machine etc..For another example, setting automatically generates after database has executed specific function and obtains data retrieval condition.
S120, determine that subregion to be retrieved, subregion to be retrieved are the subregion that partition characteristics and data retrieval condition have intersection.
In the present embodiment, partition characteristics refer to that table carries out the condition or range of subregion.When table carries out subregion, will accord with
The data for closing partition characteristics are stored in a subregion.Subregion to be retrieved refers to that partition characteristics and data retrieval condition have intersection
Subregion.
Further, subregion to be retrieved is determined according to data retrieval condition and partition characteristics.Specifically, by data retrieval item
Part is divided into partition data search condition and case of non-partitioned data retrieval condition.Partition data search condition refers to for table subregion column
Search condition, case of non-partitioned data retrieval condition are the search conditions for non-table subregion column.Illustratively, data retrieval condition is
C1>12and c1<35and c2>10, if the subregion of table is classified as c1, c1<35 c1>12and are partition data search condition,
C2 > 10 are case of non-partitioned data retrieval condition.
S130, determine that data research result, data research result are the number for meeting data retrieval condition in subregion to be retrieved
According to set.
In the present embodiment, data research result is the data acquisition system for meeting data retrieval condition in subregion to be retrieved.Into
One step, when, there are when the search condition of case of non-partitioned, data research result should meet subregion inspection simultaneously in data retrieval condition
The data acquisition system of rope condition and case of non-partitioned search condition.In the present embodiment, data research result can be a data, can also be with
It is the set of multiple data compositions.
In the present embodiment, the form of partition characteristics includes numberical range or feature list.Partition characteristics are numerical value model
The partitioned mode enclosed is known as range partition, and the partitioned mode that partition characteristics are characterized list is known as list partition.In the present embodiment
In, mainly it is introduced in the form of partition characteristics as two kinds of situations of numberical range and feature list.
In the present embodiment, a kind of mode of determining data research result is provided.It obtains any subregion to be retrieved and is used as and work as
Preceding subregion to be retrieved, and obtain the form of current partition characteristics to be retrieved.Wherein, partition characteristics and the storage of partition characteristics form
In the database.
Whether the form for judging current partition characteristics to be retrieved is numberical range or feature list, if to be retrieved point current
The form of area's feature is numberical range, then according to partition characteristics judge current subregion to be retrieved whether be subregion to be retrieved starting
The termination subregion of subregion or subregion to be retrieved;If current subregion to be retrieved is not starting sector and is not to terminate subregion, it is determined that
Total data in current subregion to be retrieved is in data research result.
It should be noted that the starting sector of subregion to be retrieved refer to it is first to be checked in all current subregions to be retrieved
Rope subregion;The termination subregion of subregion to be retrieved refers to the last one subregion to be retrieved in all current subregions to be retrieved.
Further, if the form of current partition characteristics to be retrieved is characterized list, whether judge data retrieval condition
Whole partition characteristics including current subregion to be retrieved;If data retrieval condition includes that whole subregions of current subregion to be retrieved are special
Sign;Then determine the total data in current subregion to be retrieved in data research result.If the whole point of current subregion to be retrieved
Area's feature is not by data retrieval Condition Coverage Testing;Again by all data in current subregion to be retrieved successively with data retrieval condition
Matching, and then determine the data acquisition system for meeting data retrieval condition in current subregion to be retrieved.
Data retrieval method provided in this embodiment, comprising: it obtains data retrieval condition and determines subregion to be retrieved, it is to be retrieved
Subregion is the subregion that partition characteristics and data retrieval condition have intersection;Determine that data research result, data research result are to be checked
Meet the data acquisition system of data retrieval condition in rope subregion.The present embodiment according to data retrieval condition and partition characteristics by determining
After subregion to be retrieved, data research result is determined according to data retrieval condition in subregion to be retrieved, solves the prior art
In the problem of matching with search condition, is required to each data in subregion to be retrieved, realize reduce data retrieval when
Between cost, improve search efficiency.
Embodiment two
Fig. 2 is the flow chart of data retrieval method provided by Embodiment 2 of the present invention, and the present embodiment is in the various embodiments described above
On the basis of, it preferably will further optimize data retrieval method, as shown in Fig. 2, the data retrieval method after optimization is specific
Steps are as follows:
S210, data retrieval condition is obtained.
S220, determine that subregion to be retrieved, subregion to be retrieved are the subregion that partition characteristics and data retrieval condition have intersection.
S230, partition characteristics are the subset of data retrieval condition, then the whole in the corresponding subregion to be retrieved of partition characteristics
Data are in data research result.
Further, partition characteristics are the shape that the subset of data retrieval condition includes: partition characteristics and data search condition
Formula is numberical range, then, the partition characteristics that numberical range is covered by the numberical range of data retrieval condition are data retrieval condition
Subset.
It in the present embodiment, is the continuous subregion of partition characteristics according to the subregion to be retrieved that data retrieval condition determines.
Illustratively, create table t4 (x1 int, x2 int) partition by range (x1)
(partition r1 values less than (10),
Partition r2 values less than (20),
Partition r3 values less than (30),
partition r4 values less than(40));
Create the division table t4, and partition table t4 includes 4 subregions, respectively r1, r2, r3 and r4.Point of subregion r1 to be retrieved
Area's feature is x1 < 10, partition characteristics 10≤x1 < 20 of subregion r2 to be retrieved, 20≤x1 of partition characteristics of subregion r3 to be retrieved <
30, partition characteristics 30≤x1 < 40 of subregion r4 to be retrieved.
Illustratively, if data retrieval condition is 15≤x1 < 35, then, subregion to be retrieved is r2, r3 and r4, wherein to
Retrieval subregion r2 is starting sector, and subregion r4 to be retrieved is to terminate subregion, and subregion r3 to be retrieved is neither starting sector is also not
Subregion is terminated, therefore, directly using the total data in subregion r3 to be retrieved as data research result, it is no longer necessary to will be to be retrieved
Each data in subregion r3 are successively matched with data retrieval condition, are reduced retrieval workload, have been saved time cost.Due to
Subregion r2 to be retrieved is starting sector, and subregion r4 to be retrieved is to terminate subregion, and the partition characteristics of r2 and r4 are not examined by data
Rope condition all standing, then, it needs successively to match each data in subregion r2 and r4 to be retrieved with data retrieval condition,
With successful data acquisition system as data research result.
Further, if data retrieval condition is 10≤x1 < 35, then, subregion to be retrieved is r2, r3 and r4, wherein to
Retrieval subregion r2 be starting sector, subregion r4 to be retrieved be terminate subregion, due to subregion r2 to be retrieved 10≤x1 of partition characteristics <
20 include the initial value x1=10 of data retrieval condition, then subregion r2 partition characteristics 10≤x1 < 20 to be retrieved are by data retrieval
10≤x1 of numberical range < 35 of condition is covered, then directly using the total data in subregion r2 to be retrieved as data research result,
It no longer needs successively to match each data in subregion r2 to be retrieved with data retrieval condition, reduces retrieval workload, save
About time cost.Subregion r3 to be retrieved is neither starting sector is also not termination subregion, therefore, directly by subregion r3 to be retrieved
In total data as data research result, it is no longer necessary to by each data in subregion r3 to be retrieved successively with data retrieval
Condition matching.Since subregion r4 to be retrieved is to terminate subregion, and subregion r4 partition characteristics to be retrieved are not by data retrieval condition
All standing then needs successively to match each data in subregion r4 to be retrieved with data retrieval condition, the data of successful match
Set is used as data research result.
Further, if data retrieval condition is 15≤x1 < 40, then, subregion to be retrieved is r2, r3 and r4, wherein to
Retrieval subregion r2 is starting sector, and subregion r4 to be retrieved is to terminate subregion, and subregion r3 to be retrieved is neither starting sector is also not
Subregion is terminated, therefore, directly using the total data in subregion r3 to be retrieved as data research result, it is no longer necessary to will be to be retrieved
Each data in subregion r3 are successively matched with data retrieval condition.Due to partition characteristics 30≤x1 < 40 of subregion r4 to be retrieved
Stop value do not include x1=40,15≤x1 < 40 of data retrieval condition do not include x1=40 yet, then subregion r4 to be retrieved point
Area feature 30≤x1 < 40 are covered by 15≤x1 of numberical range < 40 of data retrieval condition, then directly will be in subregion r4 to be retrieved
Total data is as data research result, it is no longer necessary to by each data in subregion r4 to be retrieved successively with data retrieval condition
Matching, reduces retrieval workload, has saved time cost.Since subregion r2 to be retrieved is starting sector, and subregion to be retrieved
R2 partition characteristics not by data retrieval condition all standing, then need by each data in subregion r2 to be retrieved successively with data
Search condition matching, the data acquisition system of successful match is as data research result.
Further, if data retrieval condition is x1 < 25, then, subregion to be retrieved is r1, r2 and r3, wherein to be retrieved
Subregion r3 is to terminate subregion, can be determined this time to be retrieved as being less than according to data retrieval condition and searched, then in addition to terminating subregion
The partition characteristics of other subregions to be retrieved are covered by the numberical range x1 < 25 of data retrieval condition certainly, then directly will be to be retrieved
Total data in subregion r1 and r2 is as data research result, it is no longer necessary to by each data in subregion r1 and r2 to be retrieved
It is successively matched with data retrieval condition, reduces retrieval workload, saved time cost.Since subregion r3 to be retrieved is to terminate
Subregion, and subregion r3 partition characteristics to be retrieved not by data retrieval condition all standing, then needing will be in subregion r3 to be retrieved
Each data are successively matched with data retrieval condition, and the data acquisition system of successful match is as data research result.
Further, if data retrieval condition is x1 < 30, then, subregion to be retrieved is r1, r2 and r3, wherein to be retrieved
Subregion r3 is to terminate subregion, can be determined this time to be retrieved as being less than according to data retrieval condition and searched, then in addition to terminating subregion
The partition characteristics of other subregions to be retrieved are covered by the numberical range x1 < 25 of data retrieval condition certainly, directly by be retrieved point
Total data in area r1 and r2 is as data research result.Further, the quilt of 20≤x1 of partition characteristics < 30 of subregion r3 is terminated
The data retrieval condition all standing of x1 < 30, then directly using the total data in subregion r3 to be retrieved as data research result.
Further, if data retrieval condition is x >=10, then, subregion to be retrieved is r2, r3 and r4, wherein to be retrieved
Subregion r2 is starting sector, can be determined this time to be retrieved as being greater than according to data retrieval condition and searched, then in addition to starting sector
The partition characteristics of other subregions to be retrieved are covered by the numberical range x >=10 of data retrieval condition certainly, directly by be retrieved point
Total data in area r3 and r4 is as data research result.Further, the quilt of 10≤x1 of partition characteristics < 20 of starting sector r2
The data retrieval condition all standing of x >=10, then directly using the total data in the r2 of starting sector as data research result.
Further, if data retrieval condition is x > 10, then, subregion to be retrieved is r2, r3 and r4, wherein to be retrieved
Subregion r2 is starting sector, can be determined this time to be retrieved as being greater than according to data retrieval condition and searched, then in addition to starting sector
The partition characteristics of other subregions to be retrieved are covered by the numberical range x >=10 of data retrieval condition certainly, directly by be retrieved point
Total data in area r3 and r4 is as data research result.Since the partition characteristics of starting sector r2 contain x1=10, then
Each data in the r2 of starting sector are needed successively to match with data retrieval condition, the data acquisition system of successful match is examined as data
Hitch fruit.
Further, if data retrieval condition is 15≤x1 < 35and y < 12,15≤x1 < 35 are area search condition,
And y < 12 be case of non-partitioned search condition, subregion to be retrieved be r2, r3 and r4, for case of non-partitioned search condition y < 12, then need by
The data research result obtained according to area search condition is matched with case of non-partitioned search condition again, determines data retrieval knot
Fruit.
Further, partition characteristics are the shape that the subset of data retrieval condition includes: partition characteristics and data search condition
Formula is characterized list, then partition characteristics of whole features in data retrieval condition are the subset of data retrieval condition.
In the present embodiment, the form of partition characteristics and data search condition is characterized list and refers to partition characteristics and data
Search condition is the occurrence of some column.
Illustratively, create table t5 (x3 varchar (10), x4 int) partition by list (x3)
(partition r5 values (' Shanghai ', ' Beijing '),
Partition r6 values (' Guangzhou ', ' Shenzhen '));
Create the division table t5, and partition table t5 includes 2 subregions, respectively r5 and r6.The partition characteristics of subregion r5 to be retrieved
For " Shanghai ", " Beijing ", the partition characteristics of subregion r6 to be retrieved are " Guangzhou ", " Shenzhen ".
If data retrieval condition is " Shanghai " and " Beijing ", directly using the total data in subregion r5 to be retrieved as number
According to search result, it is no longer necessary to successively match each data in subregion r5 to be retrieved with data retrieval condition, reduce inspection
Rope workload, has saved time cost.
If data retrieval condition be " Shanghai ", need by each data in subregion r5 to be retrieved successively with data retrieval
Condition matching, the data acquisition system of successful match is as data research result.
Data retrieval method provided in this embodiment, comprising: it obtains data retrieval condition and determines subregion to be retrieved, it is to be retrieved
Subregion is the subregion that partition characteristics and data retrieval condition have intersection;Partition characteristics are the subset of data retrieval condition, then subregion
In data research result, the present embodiment passes through according to data retrieval condition total data in the corresponding subregion to be retrieved of feature
It is whole numbers in the subregion to be retrieved of data retrieval condition subset by partition characteristics after determining retrieval subregion with partition characteristics
According to data research result is determined as, solves and each data in subregion to be retrieved is required to and retrieves item in the prior art
The problem of part matches realizes the time cost for reducing data retrieval, improves search efficiency.
Embodiment three
Fig. 3 is the flow chart for the data retrieval method that the embodiment of the present invention three provides.The present embodiment can be with above-mentioned implementation
Based on example, a kind of preferred embodiment is provided.As shown in figure 3, data retrieval method provided in this embodiment mainly includes as follows
Step:
S301, parsing sentence, are divided into partition data search condition and case of non-partitioned data retrieval condition for data retrieval condition.
In the present embodiment, the query statement to partition table of user's input is received, the language of user's input generallys use SQL format.It will
Data retrieval condition is divided into partition data search condition and case of non-partitioned data retrieval condition.It should be noted that in data retrieval
In condition, partition data search condition may be not present, it is also possible to case of non-partitioned data retrieval condition be not present.It needs according to user
Query statement be determined, not mandatory requirement be necessarily present partition data search condition or case of non-partitioned data retrieval item
Part.
S302, judge that partition data retrieves item if it exists with the presence or absence of partition data search condition in data retrieval condition
Part then executes S303;Partition data search condition if it does not exist then executes S307.
S303, judge that case of non-partitioned data are examined if it exists with the presence or absence of case of non-partitioned data retrieval condition in data retrieval condition
Rope condition, then execute S304;Case of non-partitioned data retrieval condition if it does not exist, then execute S306.
S304, partition data search condition is generated to area search symbol, and optimization label is set.
In the present embodiment, retrieval symbol is another expression way of search condition in partition table.According to partition data
Search condition generates area search symbol corresponding with area search condition, and the setting optimization label in area search symbol.?
In the present embodiment, setting optimization label is to recognize the need for optimization processing during executing Data Matching
Search condition.
S305, the child node by newly-generated area search symbol as case of non-partitioned retrieval symbol.
In the present embodiment, it should be noted that the access that retrieval needs to select subregion table object is carried out in partition table
Path and implementation procedure generate corresponding executive plan tree.In the present embodiment, area search is accorded with into corresponding node as non-
Area search accords with the child node of corresponding node, indicates that area search is first carried out when executing accords with corresponding node, the data of acquisition
As a result case of non-partitioned retrieval is executed after again and accords with corresponding node.
S306, if it exists area search condition and case of non-partitioned search condition is not present, generates normal area search symbol, and set
Set optimization label.
S307, all subregions to be retrieved are determined according to area search symbol.
In the present embodiment, subregion to be retrieved is determined according to area search symbol.It should be noted that all data retrieval items
Part is intended to generate retrieval symbol corresponding with data retrieval condition, and case of non-partitioned data retrieval condition generates and case of non-partitioned data retrieval item
The corresponding case of non-partitioned retrieval symbol of part, but in the corresponding case of non-partitioned retrieval symbol of case of non-partitioned data retrieval condition and be not provided with excellent
Change label.In the present embodiment, the subregion to be retrieved determined is either one or more.
S308, subregion to be retrieved is obtained, is denoted as current subregion to be retrieved.
In the present embodiment, subregion to be retrieved is successively obtained, current subregion to be retrieved is denoted as.
S309, judge whether current subregion to be retrieved is range partition, and retrieving has optimization to mark in symbol.
In the present embodiment, whether the divisional type for judging current subregion to be retrieved is range partition, and retrieval operator
In have optimization mark.If so, S310 is executed, if it is not, then executing S314.
Whether S310, current subregion to be retrieved are the starting sector of all subregions to be retrieved or terminate subregion, if so,
S311 is executed, if it is not, then executing S312.
In the present embodiment, the starting sector of subregion to be retrieved refers to first to be retrieved point in all subregions to be retrieved
Area;The termination subregion of subregion to be retrieved refers to the last one subregion to be retrieved in all current subregions to be retrieved.
S311, current partition characteristics to be retrieved whether the be retrieved search condition of symbol of boundary value be completely covered.If so,
S312 is executed, if it is not, then executing S316.
In the present embodiment, the boundary value of current partition characteristics to be retrieved includes initial value and stop value.
S312, the execution for ignoring search condition, directly using the total data in current subregion to be retrieved as search result.
In the present embodiment, the execution for ignoring search condition, which refers to, not to be needed each data of current subregion to be retrieved
All it is compared and matches with data retrieval condition.
S313, judge whether all subregions to be retrieved are all disposed, if so, S317 is executed, if it is not, then executing
S308。
Judge whether all subregions to be retrieved are all disposed, specific judgment method can be to look at current to be checked
Whether rope subregion terminates subregion to be retrieved.
S314, judge whether it is list partition, and retrieving has optimization to mark in symbol.If so, S315 is executed, if it is not, then
Execute S316.
S315, current subregion to be retrieved whether the be retrieved search condition of symbol of partition characteristics be completely covered, if so, holding
Row S312, if it is not, then executing S316.
The current subregion to be retrieved of S316, proper retrieval, executes according to search condition.After proper retrieval, S313 is executed.
In the present embodiment, currently subregion to be retrieved refers to each data of current subregion to be retrieved proper retrieval
Data retrieval condition is wanted to be compared and match.
S317, retrieval terminate.
Data retrieval special case provided in this embodiment, by determining retrieval subregion according to data retrieval condition and partition characteristics
Later, partition characteristics are determined as data research result for the total data in the subregion to be retrieved of data retrieval condition subset,
It solves the problems, such as in the prior art each data in subregion to be retrieved to be required to match with search condition, realizes drop
The time cost of low data retrieval improves search efficiency.
Example IV
Fig. 4 is the structural schematic diagram of data searcher that the embodiment of the present invention four provides, and the present embodiment is applicable to point
Area's table retrieves the case where data, as shown in figure 4, data retrieval side's device primary structure is as follows: module 410 is obtained, for obtaining
Access is according to search condition;
First determining module 420, for determining that subregion to be retrieved, subregion to be retrieved are partition characteristics and data retrieval condition
There is the subregion of intersection;
Second determining module 430, for determining that data research result, data research result are to meet number in subregion to be retrieved
According to the data acquisition system of search condition.
Data searcher provided in this embodiment, comprising: it obtains data retrieval condition and determines subregion to be retrieved, it is to be retrieved
Subregion is the subregion that partition characteristics and data retrieval condition have intersection;Determine that data research result, data research result are to be checked
Meet the data acquisition system of data retrieval condition in rope subregion, the present embodiment according to data retrieval condition and partition characteristics by determining
After retrieving subregion, data research result is determined further according to data retrieval condition in retrieval subregion, is solved in the prior art
The problem of matching with search condition, is required to each data in subregion to be retrieved, realizes the time for reducing data retrieval
Cost improves search efficiency.
Based on the above technical solution, specifically, the second determining module 430 is specifically used for: partition characteristics are data
The subset of search condition, then the total data in the corresponding subregion to be retrieved of partition characteristics is in data research result.
Further, partition characteristics are that the subset of data retrieval condition includes:
The form of partition characteristics and data search condition is numberical range, then, numberical range is by the data retrieval condition
Numberical range covering partition characteristics be the data retrieval condition subset.
Further, partition characteristics are that the subset of data retrieval condition includes:
The form of partition characteristics and data search condition is characterized list, then point of whole features in data retrieval condition
Area's feature is the subset of data retrieval condition
Data inspection provided by any embodiment of the invention can be performed in data searcher provided by the embodiment of the present invention
Suo Fangfa has the corresponding functional module of execution method and beneficial effect.
Embodiment five
Fig. 5 is a kind of structural schematic diagram for server that the embodiment of the present invention five provides, as shown in figure 5, the server packet
Include processor 510, memory 520, input unit 530 and output device 530;The quantity of processor 510 can be in server
One or more, in Fig. 5 by taking a processor 510 as an example;Processor 510, memory 520, input unit 530 in server
It can be connected by bus or other modes with output device 530, in Fig. 5 for being connected by bus.
Memory 520 is used as a kind of computer readable storage medium, can be used for storing software program, journey can be performed in computer
Sequence and module, if the corresponding program instruction/module of the data retrieval method in the embodiment of the present invention is (for example, data retrieval fills
Acquisition module 410, the first determining module 420 and the second determining module 430 in setting).Processor 510 is stored in by operation
Software program, instruction and module in reservoir 520, thereby executing the various function application and data processing of server, i.e.,
Realize above-mentioned data retrieval method.
Memory 520 can mainly include storing program area and storage data area, wherein storing program area can store operation system
Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to terminal.This
Outside, memory 520 may include high-speed random access memory, can also include nonvolatile memory, for example, at least one
Disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, memory 520 can be into one
Step includes the memory remotely located relative to processor 510, these remote memories can pass through network connection to equipment/end
End/server.The example of above-mentioned network includes but is not limited to internet, intranet, local area network, mobile radio communication and its group
It closes.
Input unit 530 can be used for receiving the number or character information of input, and generate the user setting with server
And the related key signals input of function control.Output device 530 may include that display screen etc. shows equipment.
Embodiment six
The embodiment of the present invention six also provides a kind of storage medium comprising computer executable instructions, and the computer can be held
Row instruction is used to execute a kind of data retrieval method when being executed by computer processor, this method comprises:
Obtain data retrieval condition;
Determine that subregion to be retrieved, subregion to be retrieved are the subregion that partition characteristics and data retrieval condition have intersection;
Determine that data research result, data research result are the data set for meeting data retrieval condition in subregion to be retrieved
It closes.
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present invention
The method operation that executable instruction is not limited to the described above, can also be performed data retrieval provided by any embodiment of the invention
Relevant operation in method
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention
It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but in many cases, the former is more
Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art
Part can be embodied in the form of software products, which can store in computer readable storage medium
In, floppy disk, read-only memory (Read-Only Memory, ROM), random access memory (Random such as computer
Access Memory, RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are with so that a computer is set
Standby (can be personal computer, server or the network equipment etc.) executes method described in each embodiment of the present invention.
It is worth noting that, included each unit and module are only pressed in the embodiment of above-mentioned data searcher
It is divided, but is not limited to the above division according to function logic, as long as corresponding functions can be realized;In addition,
The specific name of each functional unit is also only for convenience of distinguishing each other, the protection scope being not intended to restrict the invention.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.
Claims (10)
1. a kind of data retrieval method characterized by comprising
Obtain data retrieval condition;
Determine that subregion to be retrieved, the subregion to be retrieved are the subregion that partition characteristics and the data retrieval condition have intersection;
Determine that data research result, the data research result are to meet the data retrieval condition in the subregion to be retrieved
Data acquisition system.
2. data retrieval method according to claim 1, which is characterized in that the determining data research result includes:
The partition characteristics are the subset of the data retrieval condition, then complete in the corresponding subregion to be retrieved of the partition characteristics
Portion's data are in the data research result.
3. data retrieval method according to claim 2, which is characterized in that the partition characteristics are the data retrieval item
The subset of part includes:
The form of the partition characteristics and the data retrieval condition is numberical range, then, numberical range is by the data retrieval
The partition characteristics of the numberical range covering of condition are the subset of the data retrieval condition.
4. data retrieval method according to claim 2, which is characterized in that the partition characteristics are the data retrieval item
The subset of part includes:
The form of the partition characteristics and the data retrieval condition is characterized list, then, whole features are in the data retrieval
Partition characteristics in condition are the subset of the data retrieval condition.
5. a kind of data searcher characterized by comprising
Module is obtained, for obtaining data retrieval condition;
First determining module, for determining that subregion to be retrieved, the subregion to be retrieved are partition characteristics and the data retrieval item
Part has the subregion of intersection;
Second determining module, for determining that data research result, the data research result are to meet in the subregion to be retrieved
The data acquisition system of the data retrieval condition.
6. data searcher according to claim 5, which is characterized in that second determining module is specifically used for:
The partition characteristics are the subset of the data retrieval condition, then complete in the corresponding subregion to be retrieved of the partition characteristics
Portion's data are in the data research result.
7. data searcher according to claim 6, which is characterized in that the partition characteristics are the data retrieval item
The subset of part includes:
The form of the partition characteristics and the data retrieval condition is numberical range, then, numberical range is by the data retrieval
The partition characteristics of the numberical range covering of condition are the subset of the data retrieval condition.
8. data searcher according to claim 6, which is characterized in that the partition characteristics are the data retrieval item
The subset of part includes:
The form of the partition characteristics and the data retrieval condition is characterized list, then, whole features are in the data retrieval
Partition characteristics in condition are the subset of the data retrieval condition.
9. a kind of server, which is characterized in that the server includes:
One or more processors;
Memory, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
The now data retrieval method as described in any in claim 1-4.
10. a kind of storage medium comprising computer executable instructions, the computer executable instructions are by computer disposal
For executing the data retrieval method as described in any in claim 1-4 when device executes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811196264.3A CN109299101B (en) | 2018-10-15 | 2018-10-15 | Data retrieval method, device, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811196264.3A CN109299101B (en) | 2018-10-15 | 2018-10-15 | Data retrieval method, device, server and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109299101A true CN109299101A (en) | 2019-02-01 |
CN109299101B CN109299101B (en) | 2020-12-01 |
Family
ID=65162782
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811196264.3A Active CN109299101B (en) | 2018-10-15 | 2018-10-15 | Data retrieval method, device, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109299101B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110569257A (en) * | 2019-09-16 | 2019-12-13 | 上海达梦数据库有限公司 | data processing method, corresponding device, equipment and storage medium |
CN110825943A (en) * | 2019-10-23 | 2020-02-21 | 支付宝(杭州)信息技术有限公司 | Method, system and equipment for generating user access path tree data |
CN113377989A (en) * | 2021-06-04 | 2021-09-10 | 上海云从汇临人工智能科技有限公司 | Data retrieval method, system, medium and device based on GPU |
CN117573944A (en) * | 2024-01-17 | 2024-02-20 | 深圳十沣科技有限公司 | Data retrieval method, device, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101551826A (en) * | 2009-05-19 | 2009-10-07 | 成都市华为赛门铁克科技有限公司 | Data retrieval process, set and system |
US20140101167A1 (en) * | 2012-10-09 | 2014-04-10 | Alibaba Group Holding Limited | Creation of Inverted Index System, and Data Processing Method and Apparatus |
CN107633094A (en) * | 2017-10-11 | 2018-01-26 | 江苏神州信源系统工程有限公司 | The method and apparatus of data retrieval in a kind of cluster environment |
CN108170719A (en) * | 2017-12-05 | 2018-06-15 | 深圳市金立通信设备有限公司 | A kind of search method, server and computer readable storage medium |
CN108427736A (en) * | 2018-02-28 | 2018-08-21 | 华为技术有限公司 | A method of for inquiring data |
-
2018
- 2018-10-15 CN CN201811196264.3A patent/CN109299101B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101551826A (en) * | 2009-05-19 | 2009-10-07 | 成都市华为赛门铁克科技有限公司 | Data retrieval process, set and system |
US20140101167A1 (en) * | 2012-10-09 | 2014-04-10 | Alibaba Group Holding Limited | Creation of Inverted Index System, and Data Processing Method and Apparatus |
CN107633094A (en) * | 2017-10-11 | 2018-01-26 | 江苏神州信源系统工程有限公司 | The method and apparatus of data retrieval in a kind of cluster environment |
CN108170719A (en) * | 2017-12-05 | 2018-06-15 | 深圳市金立通信设备有限公司 | A kind of search method, server and computer readable storage medium |
CN108427736A (en) * | 2018-02-28 | 2018-08-21 | 华为技术有限公司 | A method of for inquiring data |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110569257A (en) * | 2019-09-16 | 2019-12-13 | 上海达梦数据库有限公司 | data processing method, corresponding device, equipment and storage medium |
CN110825943A (en) * | 2019-10-23 | 2020-02-21 | 支付宝(杭州)信息技术有限公司 | Method, system and equipment for generating user access path tree data |
CN110825943B (en) * | 2019-10-23 | 2023-10-10 | 支付宝(杭州)信息技术有限公司 | Method, system and equipment for generating user access path tree data |
CN113377989A (en) * | 2021-06-04 | 2021-09-10 | 上海云从汇临人工智能科技有限公司 | Data retrieval method, system, medium and device based on GPU |
CN117573944A (en) * | 2024-01-17 | 2024-02-20 | 深圳十沣科技有限公司 | Data retrieval method, device, equipment and storage medium |
CN117573944B (en) * | 2024-01-17 | 2024-04-02 | 深圳十沣科技有限公司 | Data retrieval method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109299101B (en) | 2020-12-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109299101A (en) | Data retrieval method, device, server and storage medium | |
US6581055B1 (en) | Query optimization with switch predicates | |
US7461060B2 (en) | Generalized partition pruning in a database system | |
CN104620239B (en) | adaptive query optimization | |
US6947927B2 (en) | Method and apparatus for exploiting statistics on query expressions for optimization | |
US7158996B2 (en) | Method, system, and program for managing database operations with respect to a database table | |
US6925462B2 (en) | Database management system, and query method and query execution program in the database management system | |
CN105975617A (en) | Multi-partition-table inquiring and processing method and device | |
US20080201296A1 (en) | Partitioning of nested tables | |
CN111008521B (en) | Method, device and computer storage medium for generating wide table | |
CN108681603B (en) | Method for rapidly searching tree structure data in database and storage medium | |
US20180165333A1 (en) | Big data calculation method and system | |
CN113836163A (en) | Data association query method, device, equipment and storage medium | |
CN106484815B (en) | A kind of automatic identification optimization method based on mass data class SQL retrieval scene | |
CA2461871A1 (en) | An efficient index structure to access hierarchical data in a relational database system | |
US8117182B2 (en) | Apparatus and method for optimizing descendant path evaluation in xpath/xquery | |
CN111506602A (en) | Data query method, device, equipment and storage medium | |
CN110502532A (en) | Optimization method, device, equipment and the storage medium of remote data base object | |
CN106484694B (en) | Full-text search method and system based on distributed data base | |
CN110019380B (en) | Data query method, device, server and storage medium | |
US6925463B2 (en) | Method and system for query processing by combining indexes of multilevel granularity or composition | |
Chen et al. | Applying segmented right-deep trees to pipelining multiple hash joins | |
US20110029480A1 (en) | Method of Compiling Multiple Data Sources into One Dataset | |
CN113821508B (en) | Method and system for realizing array index | |
CN112835905B (en) | Array type column indexing method, device, equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |