SQL In Memory

../_images/sql_memory.png

There is no need to set up a whole SQL server to run queries. When the dataset is small enough, but the processing is complex enough, it may be worth starting a SQLITE database in PHP memory, and run the queries there.

There is also a temporary database, which is created with no filename: PHP create a file for this, and removes it at the end of the execution.

Performances are usually much lower than using arrays, but complexity and standard usage may be worth the extra work.

See Also

PHP Features