the interface runs slowly
the interface runs slowly
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
Previous: Ask for help. I'll write this first how table, makes his project and quality standards draggable.
foreach ($res [ xsumpre ] as $key = > $value) { $fsql="select count(*) from (SELECT sum(sumprem) FROM datatom.fccont where signdate BETWEEN $stime AND $etime AND agentcode in (select agentcode from datatom.shouxian_faagenttree ...