> For the complete documentation index, see [llms.txt](https://chesterzhang666.gitbook.io/intro-mysql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chesterzhang666.gitbook.io/intro-mysql/operation-to-table/index.md).

# Index

为某一字段增加索引, 能够大幅度提高查询速度，其底层是由 树 实现的

## 创建一个表并且为某一字段添加索引

```sql
CREATE TABLE t_message(

	id INT UNSIGNED PRIMARY KEY,
	content VARCHAR(200) NOT NULL,
	type ENUM("ERRO","WARM","INFO") NOT NULL,
	create_time TIMESTAMP NOT NULL,
	INDEX idx_type (type)  # 为type 字段创造一个索引进行查找加速(底层是树)

);
```
