PHP Classes

Easydb Cache: Cache database query prepared statements

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 89 All time: 9,966 This week: 455Up
Version License PHP version Categories
easydb-cache 1.0MIT/X Consortium ...5PHP 5, Databases, Cache
Description 

Author

This class can cache database query prepared statements.

It extends the EasyDB database access cache to alter the way the prepared statements are processed to make it run faster.

On the first time the prepare function is called, it stores the results of the prepare function in a class variable.

Next time the prepare statement is run, it returns the values previous stored in the cache class variable.

Innovation Award
PHP Programming Innovation award nominee
January 2021
Number 6
Prepared statements are used to execute SQL queries from template strings. Those templates have marks which will be replaced by query parameter values before the query is executed.

Using prepared statements adds some overhead to the time it takes to execute a query because the query template string needs to be parsed first before the parameter values are replaced.

This class implements prepared query caching, so it avoids the overhead of parsing the same prepared statement query every time it needs to execute the same query, even if it uses different parameter values.

Manuel Lemos
Picture of Scott Arciszewski
  Performance   Level  
Name: Scott Arciszewski <contact>
Classes: 37 packages by
Country: United States United States
Age: ???
All time rank: 1173170 in United States United States
Week rank: 28 Up5 in United States United States Up
Innovation award
Innovation award
Nominee: 28x

Winner: 1x

Documentation

EasyDB (Caching)

Build Status Latest Stable Version Latest Unstable Version License Downloads

Extends EasyDB, caches Prepared Statements to reduce the number of database round trips. Requires PHP 7.2 or newer.

Support Contracts

If your company uses this library in their products or services, you may be interested in purchasing a support contract from Paragon Initiative Enterprises.


  Files folder image Files (9)  
File Role Description
Files folder imagesrc (1 file)
Files folder imagetests (1 file)
Accessible without login Plain text file .php_cs Example Example script
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file psalm.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (9)  /  src  
File Role Description
  Accessible without login Plain text file EasyDBCache.php Class Class source

  Files folder image Files (9)  /  tests  
File Role Description
  Accessible without login Plain text file EasyDBCacheTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:89
This week:0
All time:9,966
This week:455Up