Method and device for creating indexes of database

A technology of index establishment and establishment method, applied in the field of information retrieval, can solve the problems of wrong index and low index efficiency, etc.

Inactive Publication Date: 2013-12-04
ALIBABA GRP HLDG LTD
View PDF3 Cites 19 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0031] The embodiment of the present application provides a method and device for establishing a database index, which is used to solve the problem in the prior art that when the query conditions include the logical relationship of representation or relationship, the index automatically established by the computer is wrong and the artificial assistance method is used. The problem of low efficiency when building indexes

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for creating indexes of database
  • Method and device for creating indexes of database
  • Method and device for creating indexes of database

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0051] like figure 1 As shown, it is a schematic flowchart of a method for establishing a database index in Embodiment 1 of the present application, and the method includes the following steps:

[0052] Step 101: Determine N logical operators representing or relation in the query statement, where N is a positive integer.

[0053] The query statement can reflect the query condition on which the index is built, and may specifically be an SQL query statement. At the same time, the query statement in the embodiment of the present application contains logical operators representing or relational, and may also contain symbols capable of changing the operation priority of the logical operator. However, when including symbols that can change the operation priority of the logical operator, This symbol shall not change the operation order of each logical operator in the query statement. Specifically, the logical operator representing or relation may be a logical operator such as or, a...

Embodiment 2

[0097] Embodiment 2 of the present application uses specific examples to describe in detail the database index establishment method described in Embodiment 1.

[0098] Still taking the established testTable database table as an example, if the query conditions for the testTable database table are more complicated, it is to search the name from the testTable database table for "Zhang San", age is "19" and gender is "male", Or the data field whose identity number is "10010", or whose height is "180" and whose weight is "70kg" and whose nationality is "Chinese", or whose education level is "Undergraduate", the expression form of the SQL query statement is: select* from testTable where name='Zhang San'and age='19'andsex='Male'or identity='10010'or height='180'and weight='70'and nationality='China'or educationlevel='Undergraduate' , then according to the query condition in the query statement "name='Zhang San' and age='19' and sex='male' or identity='10010' or height='180' and weig...

Embodiment 3

[0125] like Figure 7 As shown, it is a schematic structural diagram of the database index establishment device described in Embodiment 3 of the present application, and the database index establishment device includes a first determination module 11, a first conversion module 12 and an index establishment module 13:

[0126] The first determining module 11 is used to determine N logical operators representing or relational in the query statement, where N is a positive integer.

[0127]Specifically, the query statement may be an SQL query statement, which can reflect the query condition on which the index is built. At the same time, the query statement in the embodiment of the present application contains logical operators representing or relational, and may also contain symbols capable of changing the operation priority of the logical operator. However, when including symbols that can change the operation priority of the logical operator, This symbol shall not change the ope...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a method and a device for creating indexes of a database. The method includes executing following operation to create the indexes if a query statement contains a logical operator indicating or relations: determining the logical operator indicating the or relations in the query statement, using the logical operator indicating the or relations as a root node of a multi-way tree, using each sub-query condition in front of the logical operator indicating the or relations and each sub-query condition behind the logical operator indicating the or relations as child nodes of the multi-way tree, converting a query condition in the query statement into a multi-way tree form, and respectively creating the indexes according to converted sub-query conditions in the various child nodes of the multi-way tree. The method and the device have the advantage that the problem of errors of automatically created indexes due to the fact that logical operators indicating or relations cannot be recognized by computers when query conditions are complicated in the prior art and the problem of low index creating efficiency when indexes are created in a manual auxiliary mode in the prior art are solved.

Description

technical field [0001] The present application relates to the technical field of information retrieval, in particular to a method and device for establishing a database index. Background technique [0002] When querying the data fields of the database table in the database, most of the fields in the database table are queried by the way of forward table traversal. In this way, although the corresponding data field information can be obtained, because each database table Both contain a large number of data fields, so it is easy to cause problems such as low data query rate, high database load, and reduced database performance. In order to avoid the above-mentioned problems, it is often used to pre-establish database indexes for database tables at present, and search for database indexes related to the current query conditions from the established database indexes, and then use the found database indexes to search for the database indexes corresponding to the query conditions....

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 王明
Owner ALIBABA GRP HLDG LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products