Unlock instant, AI-driven research and patent intelligence for your innovation.

Method for generating major key field of database table and device thereof

A database and key field technology, applied in electrical digital data processing, special data processing applications, instruments, etc., can solve the problems of inconvenient coding and long length of primary key fields, reducing database capacity, reducing the length of primary keys, and maintaining convenience. Effect

Active Publication Date: 2010-03-03
KINGDEE SOFTWARE(CHINA) CO LTD
View PDF0 Cites 19 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, the above two mainstream methods for generating the primary key field of the database table have shortcomings. Specifically, although the database sequence method has high performance and occupies the least database capacity, it must be inserted into the database before use to determine the ID value. This is very inconvenient for coding
The GUID method is very convenient to use due to its natural non-repetition, but the length of the primary key field generated by it is longer, that is, 44 bits

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 for generating major key field of database table and device thereof
  • Method for generating major key field of database table and device thereof
  • Method for generating major key field of database table and device thereof

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0036] The embodiment of the present invention provides a method and device for generating a primary key field of a database table, which can not only maintain the convenience of GUID use, but also greatly reduce the length of the primary key, and effectively improve query and index performance. In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and examples.

[0037] Such as figure 1 As shown, it is a flow chart of a method for generating a primary key field of a database table in Embodiment 1 of the present invention, and the method includes:

[0038] Step 101, obtaining the current maximum ID value;

[0039] It should be noted that the current maximum ID value can be pre-stored in the UID table in the database, or can be stored in other files, as long as the current maximum ID value can be obtained when it needs to be obt...

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 for generating a major key field of a database table and a device thereof. The method comprises the steps: obtaining the current maximum identifier ID value; increasing a preset value to the maximum ID value, and updating the current maximum ID value; respectively converting the ID value with the quantity of the preset value into preset scale to be memorized in anID pool to form the major key field of the database table available for use; and or memorizing the ID value with the quantity of the preset value into the ID pool to form the ID value available for generating the major key field of the database table, when the major key field of the database table is required to be generated, obtaining the ID value from the ID pool, and after converting the ID value into the preset scale, and forming the major key field of the database table available for use. The invention can keep the use convenience of GUID, greatly reduce the length of the major key, and effectively improve the querying performance and the index performance.

Description

technical field [0001] The invention relates to the technical field of information system application, in particular to a method and device for generating a primary key field of a database table. Background technique [0002] At present, the mainstream generation methods of the primary key field of the database table include the database sequence method and the GUID (Global Uniform Identifier) ​​method. Among them, the database sequence method refers to returning a continuously increasing value by calling the sequence function provided by the database itself, which can ensure that the value will not be repeated. The GUID method refers to a value generated on a machine, which can be guaranteed to be unique to all machines in the same time and space (worldwide). [0003] However, the above two mainstream methods for generating the primary key field of the database table have shortcomings. Specifically, although the database sequence method has high performance and occupies 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
IPC IPC(8): G06F17/30
Inventor 王小鹏
Owner KINGDEE SOFTWARE(CHINA) CO LTD