Code optimization
Copy code The code is as follows:
for($i=0;$i<8;$i++){
array_push($week,$arr);
}
Copy the code The code is as follows:
for($i=0;$i<8;$i++){
$week[]=$arr[$i];
}
//This way there is no calling function The extra burden
The benefits and disadvantages of creating an index
Benefits: When querying, the number of rows with a specific value will be located in the index list first, greatly reducing the number of matching rows traversed
Disadvantage: This table must be queried no matter what , there are a lot of repeated values in the fields, and adding indexes is meaningless. If there are relatively few records, adding indexes will not bring about speed optimization but waste storage space, because indexes require storage space, and there is a fatal disadvantage for update | Each time insert|delete is executed, the index of the field must be recalculated and updated.
The above introduces the problems encountered in the PHP interview of "Problem Children All Come from Another World OVA". I will record it here, including the content of "Problem Children All Come from Another World OVA". I hope it will be helpful to friends who are interested in PHP tutorials.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn