News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Performance analysis fetching data with PDO and PHP.
March 28, 2011 @ 08:12:20

Gonzalo Ayuso has a new post to his blog today with the results of some performance analysis he ran when fetching data with PHP and PDO.

Fetching data from databases is a common operation in our work as developers. There are many drivers (normally I use PDO), but the usage of all of them are similar and switch from one to another is not difficult (they almost share the same interface). In this post I will focus on fetching data.

He includes his sample scripts - one using just fetch() and the other using fetchAll() - that include some timing and memory checking logic and includes the results of his "limit 10000" queries from his tables. Not surprisingly, the fetchAll required more memory than the fetch call. Event changing it to a loop of fetch() methods results in about the same amount of memory as a fetchAll.

0 comments voice your opinion now!
performance analysis benchmark pdo fetch fetchall memory


blog comments powered by Disqus

Similar Posts

Matt Curry's Blog: Check Out These Upgrades I Made To The CakePHP DebugKit

Ian Selby's Blog: Put Your PHP App on Steroids - Optimizing with APC Cache

Gonzalo Ayuso's Blog: Performance analysis of Stored Procedures with PDO and PHP

Christopher Jones' Blog: New PDO_OCI Attributes

Ilia Alshanetsky's Blog: PHP 5.2 will feature libSQlite 3.3.7


Community Events

Don't see your event here?
Let us know!


version extension security series interview laravel unittest introduction video api php7 opinion podcast framework community release laravel5 library language voicesoftheelephpant

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework