---
title: "用alter table添加索引与create index区别"
author: "icbm"
date: "2014-03-03T17:12:35Z"
tags: ["MySQL"]
categories: ["数据库"]
slug: "alter-table-create-index"
draft: false
lastmod: "2014-03-03T17:13:12Z"
id: 2025034
url: "https://icbm.iteye.com/blog/2025034"
---

1、alter table一次可以添加多个索引，create index一次只能创建一个。创建多个索引时，alter table只对表扫描一次，效率较高。
2、alter table可以不指定索引名，此时将使用索引列的第一列的列名；create index必须指定索引名。

因此，alter table添加索引更灵活。

