Home > Java > javaTutorial > body text

How to add index in mybatis

藏色散人
Release: 2020-09-16 17:10:11
Original
6919 people have browsed it

How to add an index in mybatis: First open the data table; then right-click and click the [Design Table] option in the pop-up option list, thus successfully adding a normal index.

How to add index in mybatis

1. Click the table, right-click, select Design Table, enter the steps as shown below, and add a normal index:

How to add index in mybatis

2. What does the following combined index mean?

How to add index in mybatis

The effect of setting both fields as indexes is:

First: uniqueness. That is, for example, when the values ​​​​of code and pid are 3 and 4, there cannot be another record where the values ​​​​of code and pid are also 3 and 4

Second: The left side is the main and most important (the leftmost prefix matches in principle). That is, when the field on the left has no value, it seems useless if the field on the right has a value.

The above is the detailed content of How to add index in mybatis. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!