Jump to content

fastest database mysql, mysqli, pdo, postgresql


Recommended Posts

( I asked this question on a other forum too, but I want to hear you opinions because the traffic at w3schools is different than that site )Hello,I'm trying to make a fast website. The css / javascript etc is already minifyd. But now I want to make my database faster.I know it's all about indexes and structures but even when that is already done well.What schould I use by then?Mysql, mysqli, pdo or postgresql?I was using mysql but then people said mysqli was faster. Than people said choose mysqli for speed and pdo for functionallity now they are saying choose pdo it's also faster. So what is really the fastest? and again I know it's all about structure your database and index it but let's say that is already totally right.Already thank you!David

Link to post
Share on other sites

php mysql API was built for prior to mysql 4.1.3 mysql engine which lacks of some features of mysql 5.1 and after that. So if your database is mysql 5.1 or above it is recomended to use mysqli. mysql and mysqli is not different database mysqli is just improvised version of mysql. Speed difference beetween them is negligible. Where PDO is database abstruction layers which is not for any specific database engine it is a interface to use other database engine. PDO support multiple databsae engine with little change of codes which is very felixble. But it would be little bit slower as it is behind a abstruction layers.but it can be neglated.I have not use prostresql yet so i am not sure about it.If you want to faster your DB there is option for database caching there is a good comparison table in php.nethttp://in.php.net/ma...pi.choosing.php

Edited by birbal
Link to post
Share on other sites

Something to take away from that page:

The overall performance of all three extensions is considered to be about the same. Although the performance of the extension contributes only a fraction of the total run time of a PHP web request. Often, the impact is as low as 0.1%.
That last statement means that the structure and performance of your actual database is what matters, not the API you use to communicate with it. So if performance is roughly equal, then an abstraction layer like PDO or Pear DB2 would be preferable because of the flexibility.
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...