mysql中多个表的索引 [英] index for multiple tables in mysql

查看:162
本文介绍了mysql中多个表的索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用mysql.我需要从许多表中搜索信息.
为此,请让我知道如何为所有表创建索引?

来自OP的更新(已从其他位置移至此处):
我想搜索特定列的值.为此,我使用了许多表格,并使用联接查询将它们联接起来,并显示与搜索相关的行和列.

我的问题是:我在MySQL数据库中有成千上万的记录,并且当我单击搜索按钮时,该过程会变慢.为此,我想在表上使用索引.

请让我知道如何在多个表上使用索引以加快搜索过程.
谢谢.

I am using mysql. I need to search the information fron many tables.
For that, please let me know how to create index for all the tables?

UPDATE from OP (moved here from other place):
I want to search a particular column''s values. For that purpose I use many tables and join them by using join queries and display the rows and columns related to my search.

My question is this: I have thousands of records in a MySQL database and when I click the search button the process slows down. For that purpose I want to use an index on the table.

Please let me know how to use an index on multiple tables to speed up the search process.
Thank you.

推荐答案

阅读本文,对您有所帮助

http://www.databasejournal.com/features/mysql/article.php/1382791/Optimizing-MySQL-Queries-and-Indexes.htm [
Have a read of this article, it will help you

http://www.databasejournal.com/features/mysql/article.php/1382791/Optimizing-MySQL-Queries-and-Indexes.htm[^]

So, you need to check your SQL statements. Only then will you know what indexes you should be creating on what tables so that your search SQL is optimised correctly.


这篇关于mysql中多个表的索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆