Home > Database > Mysql Tutorial > body text

数据库中的表还是一定要建索引

WBOY
Release: 2016-06-07 17:44:48
Original
1743 people have browsed it

数据库中的表还是一定要建索引 上次说到在表中,加了触发器以后,会产生死锁的问题。后来又仔细再研究了一下,发现是没有对where条件面用到的字段建索引引起的,甚至连主键都没有定义。 专门测试了一下没有建索引,每分钟处理3百条,对where条件里用到的字段

数据库中的表还是一定要建索引

上次说到在表中,加了触发器以后,会产生死锁的问题。后来又仔细再研究了一下,发现是没有对where条件面用到的字段建索引引起的,甚至连主键都没有定义。

专门测试了一下没有建索引,美国服务器,每分钟处理3百条,对where条件里用到的字段建索引以后,每分钟3千条,香港服务器租用,提高了十倍。

这真是一个低级错误。 

posted on

,美国服务器
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!