Keep a record of the interview questions you had at php

  • 2020-05-07 19:22:19
  • OfStack

Code optimization
 
for($i=0;$i<8;$i++){ 
array_push($week,$arr); 
} 

 
for($i=0;$i<8;$i++){ 
$week[]=$arr[$i]; 
} 
// This eliminates the extra burden of calling functions  

Advantages and disadvantages of indexing
Benefit: the query will first go to the index list to locate the number of rows to a specific value 1 time, greatly reducing the number of rows to traverse the match
The downside: querying the table anyway, lots of duplicate values in the fields, and no point in adding an index
With fewer records, increasing the index does not lead to speed optimization but wastes storage space, because the index requires storage space, and the fatal drawback is that the index of the field must be recalculated and updated for each execution of update|insert|delete

Related articles: