The content of the invention
It is a primary object of the present invention to provide a kind of dimension querying method and device based on Multidimensional Expressions language, with
When solution prior art is handled in the dimension table of analytical database based on Multidimensional Expressions language inquiry, inquiry velocity is slow to ask
Topic.
To achieve these goals, it is according to an aspect of the invention, there is provided a kind of based on Multidimensional Expressions language
Dimension querying method.
Included according to the dimension querying method based on Multidimensional Expressions language of the present invention:Determine querying condition and analysis number
According to the index and dimension table to be checked for meeting querying condition in storehouse;The first dimension table in dimension table to be checked is obtained, its
In, the first dimension table is the dimension table that member value quantity is more than predetermined threshold value in dimension table to be checked;Meeting querying condition
Index in determine the first index, wherein, the first index is the indexs of mapping relations with the first dimension table be present;Refer to according to first
Mark and filtration treatment is carried out to the member value in the first dimension table, obtain member's value set;Multidimensional Expressions language inquiry is received to refer to
Order, wherein, the instruction of Multidimensional Expressions language inquiry is the query statement obtained based on member's value set;And reached according to multi-dimensional table
The instruction of formula language inquiry performs query processing to member's value set.
Further, determine that the first index includes in the index for meet querying condition:It is determined that meet inquiry in true table
The index of condition, wherein, true table is used to store index all in analytical database;Obtain the index and first of querying condition
Mapping relations between dimension table;And the first index according to corresponding to mapping relations obtain the first dimension table.
Further, receiving the instruction of Multidimensional Expressions language inquiry includes:Determine member's value set;Receive filtering instructions,
Wherein, filtering instructions are for being filtered to member's value set, obtaining the instruction of member's value set of non-NULL;Referred to according to filtering
Order is filtered to member's value set, obtains member's value set of non-NULL;According to member's value set of non-NULL, it is determined that with non-NULL
Multidimensional Expressions language inquiry corresponding to member's value set instructs;And receive the instruction of Multidimensional Expressions language inquiry.
Further, the first dimension table obtained in dimension table to be checked includes:Determine each in dimension table to be checked
The member value quantity of dimension table;Obtain the dimension table that member value quantity in dimension table to be checked is more than predetermined threshold value;Determine thing
Index in real table, wherein, true table is used to store index all in analytical database;And by dimension table to be checked
Member value quantity is more than the dimension table of predetermined threshold value and the Index Establishment mapping relations in true table, obtains the first dimension table.
Further, filtration treatment is carried out to the member value in the first dimension table according to the first index, obtains member value collection
Conjunction includes:Determine the member value in the first dimension table;Judge whether the member value in the first dimension table deposit with the first index
In mapping relations;If mapping relations, removing members value is not present with the first index in the member value in the first dimension table;And such as
There are mapping relations in the member value in the dimension table of fruit first, retain member value with the first index.
To achieve these goals, according to another aspect of the present invention, there is provided a kind of based on Multidimensional Expressions language
Dimension inquiry unit.
Included according to the dimension inquiry unit based on Multidimensional Expressions language of the present invention:First determining unit, for true
The index for determining to meet querying condition in querying condition and analytical database and dimension table to be checked;Acquiring unit, for obtaining
The first dimension table in dimension table to be checked, wherein, the first dimension table is that member value quantity is more than in dimension table to be checked
The dimension table of predetermined threshold value;Second determining unit, for determining the first index in the index for meet querying condition, wherein, the
One index is the index for existing with the first dimension table mapping relations;Filter element, for according to the first index to the first dimension table
In member value carry out filtration treatment, obtain member's value set;Receiving unit, refer to for receiving Multidimensional Expressions language inquiry
Order, wherein, the instruction of Multidimensional Expressions language inquiry is the query statement obtained based on member's value set;And processing unit, use
Query processing is performed to member's value set in being instructed according to Multidimensional Expressions language inquiry.
Further, the second determining unit includes:First determining module, for determining to meet querying condition in true table
Index, wherein, true table is used to store index all in analytical database;First acquisition module, for obtaining querying condition
Index and the first dimension table between mapping relations;And second acquisition module, for obtaining the first dimension according to mapping relations
Spend the first index corresponding to table.
Further, receiving unit includes:Second determining module, for determining member's value set;Receiving module, for connecing
Filtering instructions are received, wherein, filtering instructions are for being filtered to member's value set, obtaining the finger of member's value set of non-NULL
Order;Filtering module, for being filtered according to filtering instructions to member's value set, obtain member's value set of non-NULL;3rd is true
Cover half block, for member's value set according to non-NULL, it is determined that Multidimensional Expressions language corresponding with member's value set of non-NULL is looked into
Ask instruction;And the 3rd acquisition module, for receiving the instruction of Multidimensional Expressions language inquiry.
Further, acquiring unit includes:4th determining module, for determining each dimension table in dimension table to be checked
Member value quantity;4th acquisition module, the dimension of predetermined threshold value is more than for obtaining member value quantity in dimension table to be checked
Table;5th determining module, for determining the index in true table, wherein, true table is all in analytical database for storing
Index;And the 5th acquisition module, for member value quantity in dimension table to be checked is more than the dimension table of predetermined threshold value with
Index Establishment mapping relations in true table, obtain the first dimension table.
Further, filter element includes:6th determining module, for determining the member value in the first dimension table;Judge
Module, for judging whether the member value in the first dimension table with the first index whether there is mapping relations;Removing module, it is used for
In the case that mapping relations are not present with the first index in member value in the first dimension table, removing members value;And retain mould
Block, in the case of mapping relations being present for the member value in the first dimension table and the first index, retain member value.
By the present invention, using following steps:Determine the index for meeting querying condition in querying condition and analytical database
With dimension table to be checked;The first dimension table in dimension table to be checked is obtained, wherein, the first dimension table is dimension to be checked
Spend the dimension table that member value quantity in table is more than predetermined threshold value;The first index is determined in the index for meet querying condition, wherein,
First index is the index for existing with the first dimension table mapping relations;The member value in the first dimension table is entered according to the first index
Row filtration treatment, obtain member's value set;The instruction of Multidimensional Expressions language inquiry is received, wherein, Multidimensional Expressions language inquiry
Instruction is the query statement obtained based on member's value set;And instructed according to Multidimensional Expressions language inquiry to member's value set
Query processing is performed, when solving in the dimension table of analytical database based on the processing of Multidimensional Expressions language inquiry, inquiry speed
The problem of slow is spent, and then when in the dimension table of analytical database based on the processing of Multidimensional Expressions language inquiries, deduction
The effect of inquiry velocity.
Embodiment
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the application can phase
Mutually combination.Describe the present invention in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order that those skilled in the art more fully understand application scheme, below in conjunction with the embodiment of the present application
Accompanying drawing, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described embodiment is only
The embodiment of the application part, rather than whole embodiments.Based on the embodiment in the application, ordinary skill people
The every other embodiment that member is obtained under the premise of creative work is not made, it should all belong to the model of the application protection
Enclose.
It should be noted that term " first " in the description and claims of this application and above-mentioned accompanying drawing, "
Two " etc. be for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so use
Data can exchange in the appropriate case, so as to embodiments herein described herein.In addition, term " comprising " and " tool
Have " and their any deformation, it is intended that cover it is non-exclusive include, for example, containing series of steps or unit
Process, method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include without clear
It is listing to Chu or for the intrinsic other steps of these processes, method, product or equipment or unit.
Fig. 1 is the flow chart of the dimension querying method based on Multidimensional Expressions language according to a first embodiment of the present invention.
As shown in figure 1, this method includes steps S101 to step S106:
Step S101, the index and dimension to be checked for determining to meet querying condition in querying condition and analytical database
Table.
Receive and determine querying condition, determine to meet the index of querying condition in analytical database and in analytical database
In determine to need the dimension table inquired about in multiple dimension tables.
Step S102, obtain the first dimension table in dimension table to be checked.
Obtain the first dimension table in dimension table to be checked, wherein, the first dimension table be in dimension table to be checked into
Member's value quantity is more than the dimension table of predetermined threshold value.
Preferably, the first dimension table obtained in dimension table to be checked includes:Determine respectively to tie up in dimension table to be checked
Spend the member value quantity of table;Obtain the dimension table that member value quantity in dimension table to be checked is more than predetermined threshold value;It is it is determined that true
Index in table, wherein, true table is used to store index all in analytical database;And by dimension table to be checked into
Member's value quantity is more than the dimension table of predetermined threshold value and the Index Establishment mapping relations in true table, obtains the first dimension table.
By the member value quantity of each dimension table in dimension table to be checked, member value number in dimension table to be checked is obtained
Amount is the first dimension table more than the dimension table of predetermined threshold value, that is, determines big dimension table.
Step S103, the first index is determined in the index for meet querying condition.
The index that mapping relations be present with the first dimension table is determined the fact the analytical database in table, according still further to inquiry bar
Part screens to the index, using the index filtered out as the first index.
Preferably, determine that the first index includes in the index for meet querying condition:It is determined that meet inquiry bar in true table
The index of part, wherein, true table is used to store index all in analytical database;Obtain the index and the first dimension of querying condition
The mapping relations spent between table;And the first index according to corresponding to mapping relations obtain the first dimension table.
By obtaining the mapping relations between the index of querying condition and the first dimension table, is obtained according to the mapping relations
First index corresponding to dimension table.So as to determine the first index in the index for meet querying condition.
Step S104, filtration treatment is carried out to the member value in the first dimension table according to the first index, obtains member value collection
Close.
According to above-mentioned the first index for meeting querying condition, filtration treatment is carried out to the member value in the first dimension table, obtained
To member's value set.
Preferably, filtration treatment is carried out to the member value in the first dimension table according to the first index, obtains member's value set
Including:Determine the member value in the first dimension table;Judge whether the member value in the first dimension table whether there is with the first index
Mapping relations;If mapping relations, removing members value is not present with the first index in the member value in the first dimension table;And if
There are mapping relations in the member value in the first dimension table, retain member value with the first index.
By judging whether the member value in the first dimension table with the first index whether there is mapping relations, deletion is not present
Mapping relations dimension table in member value and retain and member value in the dimension table of mapping relations be present with the first index.
By the step, few members' value in dimension table is deleted, i.e., the member value of big dimension is not done for empty angle from index
Once quickly filtering, so as to when being handled based on Multidimensional Expressions language inquiry, improve inquiry velocity.
Step S105, receive the instruction of Multidimensional Expressions language inquiry.
Multidimensional Expressions language (multi-dimensional expressions, referred to as MDX) query statement is received,
Wherein, the instruction of Multidimensional Expressions language inquiry is the query statement obtained based on member's value set.
It should be noted that the Multidimensional Expressions language that reception Multidimensional Expressions language inquiry instruction herein is an externally input
The Multidimensional Expressions language inquiry instruction of speech inquiry code building.
For example, receiving MDX query statements, specific MDX query statements are:count({(filter(nonempty({[P
age].[OriginalUrl].children},[Measures].[pageviews]);I.e. to the dimension table for pageviews
Carry out member value of the inquiry for children.
Step S106, query processing is performed to member's value set according to the instruction of Multidimensional Expressions language inquiry.
Query processing is performed to member's value set according to the above-mentioned Multidimensional Expressions language inquiry instruction received, looked into
Ask result.
It should be noted that to big in the dimension querying method provided in an embodiment of the present invention based on Multidimensional Expressions language
When dimension does the filtering of Filter row ranks, can use dimension chain in other dimensions filter out jointly corresponding index (i.e. with
Big dimension has direct correlation), first once quickly filtering, then right is not done to the member value of big dimension for empty angle from index
It does the filtering of row rank, the set sizes of the filtering of Filter row rank can be substantially reduced, so as to improve inquiry velocity.
Dimension querying method provided in an embodiment of the present invention based on Multidimensional Expressions language, by determine querying condition and
Meet the index of querying condition and dimension table to be checked in analytical database;Obtain the first dimension in dimension table to be checked
Table, wherein, the first dimension table is the dimension table that member value quantity is more than predetermined threshold value in dimension table to be checked;Meeting inquiry
The first index is determined in the index of condition, wherein, the first index is the index for existing with the first dimension table mapping relations;According to
One index carries out filtration treatment to the member value in the first dimension table, obtains member's value set;Multidimensional Expressions language is received to look into
Instruction is ask, wherein, the instruction of Multidimensional Expressions language inquiry is the query statement obtained based on member's value set;And according to multidimensional
Expression language query statement performs query processing to member's value set, solves in the dimension table of analytical database based on more
When tieing up the processing of expression formula language inquiry, the problem of inquiry velocity is slow, and then be based in the dimension table of analytical database
During the processing of Multidimensional Expressions language inquiry, the effect for inquiry velocity of deducting a percentage.
Fig. 2 is the flow chart of the dimension querying method based on Multidimensional Expressions language according to a second embodiment of the present invention.
Fig. 2 can be as a kind of preferred embodiment of embodiment illustrated in fig. 1.As shown in Fig. 2 this method includes steps S201
To step S210:
Step S201, the index and dimension to be checked for determining to meet querying condition in querying condition and analytical database
Table.
The step repeats no more here with step S101.
Step S202, the first dimension table in dimension table to be checked is obtained, wherein, the first dimension table is dimension to be checked
Spend the dimension table that member value quantity in table is more than predetermined threshold value.
The step repeats no more here with step S102.
Step S203, the first index is determined in the index for meet querying condition, wherein, the first index is and the first dimension
The index of mapping relations be present in table.
The step repeats no more here with step S103.
Step S204, filtration treatment is carried out to the member value in the first dimension table according to the first index, obtains member value collection
Close.
The step repeats no more here with step S104.
Step S205, determine member's value set.
Determine it is above-mentioned according to the first index in the first dimension table member value carry out filtration treatment, obtained member value collection
Close.
Step S206, receive filtering instructions.
Filtering instructions are received, wherein, filtering instructions are for being filtered to member's value set, obtaining the member value of non-NULL
The instruction of set.
Step S207, member's value set is filtered according to filtering instructions, obtains member's value set of non-NULL.
Member's value set is filtered according to filtering instructions, obtains member's value set of non-NULL.It is not sky i.e. from index
Angle the member value of big dimension is done once quickly filtering.
Step S208, according to member's value set of non-NULL, it is determined that Multidimensional Expressions corresponding with member's value set of non-NULL
Language inquiry instructs.
According to the above-mentioned member's value set for obtaining non-NULL, Multidimensional Expressions corresponding with member's value set of non-NULL are determined
Language inquiry instructs.
For example, the above-mentioned member's value set for obtaining non-NULL is pageviews;Determine corresponding with member's value set of non-NULL
Multidimensional Expressions language inquiry instruction be:count({(filter(nonempty({[Page].[OriginalUrl]
.children},[Measures].[pageviews]);It is children i.e. to carrying out inquiry for pageviews dimension table
Member value.
Step S209, obtain the instruction of Multidimensional Expressions language inquiry.
The instruction of Multidimensional Expressions language inquiry is obtained, wherein, the instruction of Multidimensional Expressions language inquiry is to be based on member value collection
Close obtained query statement.
Step S210, query processing is performed to member's value set according to the instruction of Multidimensional Expressions language inquiry.
The step repeats no more here with step S106.
Dimension querying method provided in an embodiment of the present invention based on Multidimensional Expressions language, by determine querying condition and
Meet the index of querying condition and dimension table to be checked in analytical database;Obtain the first dimension in dimension table to be checked
Table, wherein, the first dimension table is the dimension table that member value quantity is more than predetermined threshold value in dimension table to be checked;Meeting inquiry
The first index is determined in the index of condition, wherein, the first index is the index for existing with the first dimension table mapping relations;According to
One index carries out filtration treatment to the member value in the first dimension table, obtains member's value set;Determine member's value set;Received
Filter instruction, wherein, filtering instructions are for being filtered to member's value set, obtaining the instruction of member's value set of non-NULL;Root
Member's value set is filtered according to filtering instructions, obtains member's value set of non-NULL;According to member's value set of non-NULL, it is determined that
Multidimensional Expressions language inquiry instruction corresponding with member's value set of non-NULL;And obtain Multidimensional Expressions language inquiry and refer to
Order;And query processing is performed to member's value set according to the instruction of Multidimensional Expressions language inquiry, solve in analytical database
Dimension table in based on the processing of Multidimensional Expressions language inquiry when, the problem of inquiry velocity is slow, and then in analyze data
When in the dimension table in storehouse based on the processing of Multidimensional Expressions language inquiry, the effect for inquiry velocity of deducting a percentage.
It should be noted that can be in such as one group of computer executable instructions the flow of accompanying drawing illustrates the step of
Performed in computer system, although also, show logical order in flow charts, in some cases, can be with not
The order being same as herein performs shown or described step.
The embodiment of the present invention additionally provide a kind of dimension inquiry unit based on Multidimensional Expressions language, it is necessary to explanation
It is that the dimension inquiry unit based on Multidimensional Expressions language of the embodiment of the present invention can be used for the execution embodiment of the present invention and be carried
What is supplied is used for the dimension querying method based on Multidimensional Expressions language.Reached below to provided in an embodiment of the present invention based on multi-dimensional table
The dimension inquiry unit of formula language is introduced.
Fig. 3 is the schematic diagram according to the dimension inquiry unit based on Multidimensional Expressions language of the present invention.As shown in figure 3,
The device includes:First determining unit 10, acquiring unit 20, the second determining unit 30, filter element 40, receiving unit 50 and place
Manage unit 60.
First determining unit 10, for the index that determines to meet querying condition in querying condition and analytical database and to be checked
The dimension table of inquiry.
Acquiring unit 20, for obtaining the first dimension table in dimension table to be checked, wherein, the first dimension table is to be checked
Member value quantity is more than the dimension table of predetermined threshold value in the dimension table of inquiry.
Preferably, in the dimension inquiry unit provided in an embodiment of the present invention based on Multidimensional Expressions language, obtain single
Member 20 includes:4th determining module, for determining the member value quantity of each dimension table in dimension table to be checked;4th obtains mould
Block, the dimension table of predetermined threshold value is more than for obtaining member value quantity in dimension table to be checked;5th determining module, for true
Index in fixed true table, wherein, true table is used to store index all in analytical database;And the 5th acquisition module,
Dimension table for member value quantity in dimension table to be checked to be more than to predetermined threshold value maps with the Index Establishment in true table
Relation, obtain the first dimension table.
Second determining unit 30, for determining the first index in the index for meet querying condition, wherein, the first index is
The index of mapping relations with the first dimension table be present.
Preferably, in the dimension inquiry unit provided in an embodiment of the present invention based on Multidimensional Expressions language, second is true
Order member 30 includes:First determining module, for the index for determining to meet querying condition in true table, wherein, true table is used for
Store index all in analytical database;First acquisition module, for obtain the index of querying condition and the first dimension table it
Between mapping relations;And second acquisition module, for the first index corresponding to obtaining the first dimension table according to mapping relations.
Filter element 40, for carrying out filtration treatment to the member value in the first dimension table according to the first index, obtain into
Member's value set.
Preferably, in the dimension inquiry unit provided in an embodiment of the present invention based on Multidimensional Expressions language, the filtering
Unit 40 includes:6th determining module, for determining the member value in the first dimension table;Judge module, for judging the first dimension
Whether the member value in degree table with the first index whether there is mapping relations;Removing module, in the first dimension table into
In the case that mapping relations are not present with the first index in member's value, removing members value;And reservation module, in the first dimension table
In member value and the first index mapping relations be present in the case of, retain member value.
Receiving unit 50, for receiving the instruction of Multidimensional Expressions language inquiry, wherein, the instruction of Multidimensional Expressions language inquiry
It is the query statement obtained based on member's value set.
Preferably, in the dimension inquiry unit provided in an embodiment of the present invention based on Multidimensional Expressions language, the reception
Unit 50 includes:Second determining module, for determining member's value set;Receiving module, for receiving filtering instructions, wherein, mistake
Filter instruction is for being filtered to member's value set, obtaining the instruction of member's value set of non-NULL;Filtering module, for basis
Filtering instructions filter to member's value set, obtain member's value set of non-NULL;3rd determining module, for according to non-NULL
Member's value set, it is determined that Multidimensional Expressions language inquiry corresponding with member's value set of non-NULL instructs;And the 3rd obtain mould
Block, for obtaining the instruction of Multidimensional Expressions language inquiry.
Processing unit 60, for performing query processing to member's value set according to the instruction of Multidimensional Expressions language inquiry.
Dimension inquiry unit provided in an embodiment of the present invention based on Multidimensional Expressions language, passes through the first determining unit 10
The index for determining to meet querying condition in querying condition and analytical database and dimension table to be checked;Acquiring unit 20 is obtained and treated
The first dimension table in the dimension table of inquiry, wherein, the first dimension table is that member value quantity is more than in advance in dimension table to be checked
If the dimension table of threshold value;Second determining unit 30 determines the first index in the index for meet querying condition, wherein, the first index
The index of mapping relations with the first dimension table to be present;Filter element 40 is according to the first index to the member value in the first dimension table
Filtration treatment is carried out, obtains member's value set;Receiving unit 50 receives the instruction of Multidimensional Expressions language inquiry, wherein, multi-dimensional table
It is the query statement obtained based on member's value set up to the instruction of formula language inquiry;And processing unit 60 is according to Multidimensional Expressions language
Say that query statement performs query processing to member's value set, solve and Multidimensional Expressions are based in the dimension table of analytical database
During language inquiry processing, the problem of inquiry velocity is slow, and then reached in the dimension table of analytical database based on multi-dimensional table
During the processing of formula language inquiry, the effect for inquiry velocity of deducting a percentage.
Obviously, those skilled in the art should be understood that above-mentioned each module of the invention or each step can be with general
Computing device realize that they can be concentrated on single computing device, or be distributed in multiple computing devices and formed
Network on, alternatively, they can be realized with the program code that computing device can perform, it is thus possible to they are stored
Performed in the storage device by computing device, either they are fabricated to respectively each integrated circuit modules or by they
In multiple modules or step be fabricated to single integrated circuit module to realize.So, the present invention is not restricted to any specific
Hardware and software combines.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area
For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies
Change, equivalent substitution, improvement etc., should be included in the scope of the protection.