简体   繁体   中英

how to speed up my query in sql

I create 2 views where the first view gets the details of the asset and other views count the audited asset. I combine the two views to create the main view report but my problem it takes 5 minutes to generate the data and cause timeout error in my application. Can I use the index to speed up my query or do have a trick you use to speed up your query?

You can use index in uniq fields. While you are joining the tables, you can add more filtres. You can check your join parameters. Actually, it depends on your database and views.

Also you can search it in this site : https://dev.mysql.com/doc/refman/5.5/en/using-explain.html

İt is a special example for you. You can learn this topic with this link: How to speed up sql queries ? Indexes?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM