PHP ladies and gentlemen, there are ten queries in an interface. How can sql be optimized in terms of code?

the interface runs slowly

Oct.23,2021

minimize the number of sql


slow, you have to figure out where to slow first. What answer do you want if you write a few words like this?

if sql is slow, let's see if the database connection is normal. Is there anything wrong with your writing? Whether the index has been built or not, etc.


possible reasons:
1. Join table query
2. Query
3 in the loop Heavy use of subqueries

Menu