How can I determine the overhead of array operations and database operations? If it is not a particularly complex operation, it is better to query the database multiple times to obtain data, or to query the database once, and then splice the database with arrays? How can I determine which operation has a high overhead? Thank you! how does the php database determine the overhead of array operations and database operations?
If it is not a particularly complex operation, it is better to query the database multiple times to obtain data, or to query the database once, and then splice the database with arrays? How can I determine which operation has a high overhead? Thank you.
Php database data array
Share:
------ Solution --------------------
If your database is a relational database such as mysql and the bottleneck is disk read/write IO, try to minimize it, because PHP array operations are memory operations after all; it doesn't matter if redis or mongo is a database with a memory cache mechanism.
------ Solution --------------------
Php functions operate on memory and mysql reads IO.