[MDB] Final thought
| From: | Thierry Bothorel | Date: | Wed, 17 Sep 2003 06:38:10 +0000 |
| Subject: | [MDB] Final thought | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-7859@lists.php.net to get a copy of this message | ||
Hi Lukas,
I finally finished the move to MDB for my mrbs package! It works fine at
home on MySQL, and I released a test package, now I wait for feedbacks from
users with the others DBMS.
I did not tried first to optimize the code to use the more 'advanced'
functions doing the query, fetching row and freeing result, because I first
did not wanted to change the existing code around database functions. So, a
lot of fetchInto, but I use them when I can.
I noticed a slight longer response time to all pages, but I knew that it
will be the case, but this is not very noticable because this application
does not use databases intensively.
I had only a problem with an external script used to fill the database with
random data for demo (around 1200 rows). The script is ran in 17 seconds on
my computer with the previous database wrapper, and... hum, between 40 and
45 seconds with MDB. As the same SQL statement is executed 1200 times within
nested loops, I used prepared querys to speed up this, but this was useless
with my MyISAM Mysql tables. So I reduced the row number to 700 to not
exceed the default 30 seconds time limit for php scripts.
Well ,one last question. What is the main purpose of functions lile
queryAll? Is this only to write less lines of code?
Well, we write one line instead of three (query, fetch, free), but after
that, to retrieve the data, instead of writing code to loop through the
result set to fetch the data, we have to loop through the nested array
instead.
An just a note about documentation. It would be nice to have all in one
place. The included html pages cover all function, wether the PEAR manual
lack a lot of functions, but have nice introduction for beginners.
Thanks for you 'state of the art' piece of code.
Thierry Bothorel.