Code optimization
Copy code The code is as follows:
for($i=0;$i<8;$i++){
array_push($week,$arr);
}
Copy code The code is as follows:
for($i=0;$i<8;$i++){
$week[]=$arr[$i];
}
//This way there is no need to call the function The additional burden
The benefits and disadvantages of indexing Benefits: When querying, the number of rows with a specific value will be located in the index list at one time, greatly reducing traversal Number of matching rows
Disadvantages: This table has to be queried no matter what, and there are a lot of duplicate values in the fields. It is meaningless to add indexes.
There are relatively few records. Adding indexes will not bring about speed optimization but will waste storage space. , because the index requires storage space, and a fatal disadvantage is that for each execution of update|insert|delete, the index of the field must be recalculated and updated.
http://www.bkjia.com/PHPjc/323587.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/323587.htmlTechArticleCode optimization copy code The code is as follows: for($i=0;$i8;$i++){ array_push($ week,$arr); } Copy the code as follows: for($i=0;$i8;$i++){ $week[]=$arr[$i]; } //This way there is no need to call the function...