CREATE INDEX part_of_name ON customer (name(10)); 입력하세요
CREATE TABLE lookup (id INT) ENGINE = MEMORY;
CREATE INDEX id_index ON lookup (id) USING BTREE;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Index;
import javax.persistence.Table;
@Entity
@Table(name = "region",
indexes = {@Index(name = "my_index_name", columnList="iso_code", unique = true),
@Index(name = "my_index_name2", columnList="name", unique = false)})
public class Region{
@Column(name = "iso_code", nullable = false)
private String isoCode;
@Column(name = "name", nullable = false)
private String name;
}
참고)
https://en.wikipedia.org/wiki/Full_table_scan
https://en.wikipedia.org/wiki/Database_index
http://shadowxx.egloos.com/2333505
https://dev.mysql.com/doc/refman/5.7/en/create-index.html
https://technet.microsoft.com/ko-kr/library/ms177443(v=sql.105).aspx
https://stackoverflow.com/questions/3405229/specifying-an-index-non-unique-key-using-jpa
https://nesoy.github.io/articles/2017-07/DBIndex