Method, device, server and storage medium for creating database index

A technology for creating indexes and databases, applied in the field of databases, can solve problems such as other transactions cannot modify data tables, business systems cannot operate effectively, and the duration increases

Active Publication Date: 2020-08-14
SHANGHAI DAMENG DATABASE
View PDF5 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] In the existing technology, when creating or rebuilding an index on a data table, the data table is often locked, so that other transactions cannot modify the data table, and the entire business system is suspended and cannot be used effectively. Running, and as the amount of data in the data table increases, the duration of this effect will increase with the increase in the amount of data, and this effect is usually unacceptable

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, device, server and storage medium for creating database index
  • Method, device, server and storage medium for creating database index
  • Method, device, server and storage medium for creating database index

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0035] figure 1 It is a flowchart of a method for creating a database index provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation where other transactions are allowed to modify the data table when creating a database index for the data table. The method can be created by creating a database index It can be implemented by a device, which can be implemented by software and / or hardware, and can generally be integrated in a database server. The method specifically includes the following steps:

[0036] Step 101, according to the index creation transaction, determine the data table to be indexed.

[0037] When a user needs to create or rebuild an index for a data table in the database, an index creation transaction can be initiated, which includes the data table to be indexed, so that the data to be created can be determined based on the index creation transaction surface. When rebuilding the index, you need to delete the existing inde...

Embodiment 2

[0072] figure 2 It is a flowchart of a method for creating a database index provided by Embodiment 2 of the present invention. This embodiment is optimized on the basis of the above embodiments. Specifically, by creating an auxiliary table and an auxiliary trigger for triggering and saving modified records to merge index data based on modified records in auxiliary tables. The method specifically includes the following steps:

[0073] Step 201, according to the index creation transaction, determine the data table to be indexed.

[0074] Step 202, add an IX lock and an S lock to the data table.

[0075] Step 203, adding the data dictionary of the index to be created to the database system table, determining the corresponding index to be created, and creating an auxiliary table and corresponding auxiliary triggers for storing modification records.

[0076] While adding the data dictionary of the index to be created in the database system table, an auxiliary table and correspo...

Embodiment 3

[0103] Figure 4 It is a flow chart of a method for creating a database index provided by Embodiment 3 of the present invention. This embodiment is optimized on the basis of the above embodiments. Specifically, by re-adding the S lock to the data table according to whether the The lock succeeds to determine whether to continue merging the modified records in the auxiliary table into the index data. The method specifically includes the following steps:

[0104] Step 301, according to the index creation transaction, determine the data table to be indexed.

[0105] Step 302, adding an IX lock and an S lock to the data table.

[0106] Step 303, adding the data dictionary of the index to be created to the database system table, determining the corresponding index to be created, and creating an auxiliary table and corresponding auxiliary triggers for saving modification records.

[0107] Step 304, releasing the S lock on the data table.

[0108] Step 305, according to the data d...

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 database index creating method and device, a server and a storage medium. The method comprises: determining a data table to be subjected to index creating; adding IX lock andS lock to the data table; adding a data dictionary to be subjected to index creating into a database system table, and determining a corresponding index to be created; releasing the S lock on the data table; filling the index to be created, with index data according to the data table and the data dictionary, and when other businesses, except for an index creating business, to modify the data table are received, saving the corresponding modification records; combining the modification records to the index data; submitting the index creating business. It is achieved herein that other businessesare allowed to modify the data table during data table index creating.

Description

technical field [0001] Embodiments of the present invention relate to database technology, and in particular to a method, device, server and storage medium for creating a database index. Background technique [0002] With the advent of the era of big data and cloud computing, the change in data volume is showing an exponential growth trend. When a database business system is running, it is often necessary to create or rebuild an index on a data table for some reason. [0003] In the existing technology, when creating or rebuilding an index on a data table, the data table is often locked, so that other transactions cannot modify the data table, and the entire business system is suspended and cannot be used effectively. Running, and as the amount of data in the data table increases, the duration of this effect will increase with the increase in the amount of data, and this effect is usually unacceptable. Contents of the invention [0004] In view of this, embodiments of th...

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 Patents(China)
IPC IPC(8): G06F16/22G06F16/23
CPCG06F16/2246G06F16/2272G06F16/2358
Inventor 王家贤
Owner SHANGHAI DAMENG DATABASE
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