Home >Java >javaTutorial >How to add index in mybatis

How to add index in mybatis

藏色散人
藏色散人Original
2019-05-08 15:37:486994browse

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!

Statement:
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