[TYPO3-dev] mysql/mysqli and prepared statements

ries van Twisk typo3 at rvt.dds.nl
Sun Oct 7 05:26:41 CEST 2007


first of all, I am not a MySQL guy, I just remembered
about the prepared statements and teh query cache....

One other thought I have and wanted to share....


I can only speak for PostgreSQL, but when
a prepared query gets send to the server
the SQL engine needs to create a query plan for
the SQL, I can only assume that MySQL does the same...

One problem with this that the query plan
might need to change with different parameters
for optimal performance. However, since it's a prepared
query, it will not change!!! Please note that PostgreSQL
uses statistics to decide how to execute a query,
I don't know details about MySQL.

Also, when I look at our current SQL queries, they are really simple,
so it might be faster for the RDBM just to figure out the optimal
execution plan for each query, rather then use prepared
statements which can result in sub-optimal performance (see my last  
mail).

What I am trying to say is that by using prepared statements it
will not guarantee better performance but can also result
in less performance. Best way to figure this out
is by doing real world performance test on our queries
and see if we really benefit.


Ries





On Oct 6, 2007, at 4:07 PM, Martin Kutschker wrote:

> Hi!
>
> Shall TYPO3 provide means to use the mysqli-driver and get support for
> prepared statements? I say yes. There are places in the Core where the
> "same" statement is called within a loop.
>
> Easiest way: make a "mysqli" sysext which gets installed automatically
> if the installer finds mysqli is loaded.
>
> ALternative way: make t3lib_div::makeInstance factory aware. That  
> means
> it should see if the class in question has a factory method and call
> that. Add a factory to trlib_db that returns an instance of
> t3lib_db_mysqli if the PHP extension is loaded.
>
> Masi
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev

--
Ries van Twisk
Freelance TYPO3 Developer
email: ries at vantwisk.nl
web:   http://www.rvantwisk.nl/
skype: callto://r.vantwisk
Phone: + 1 810-476-4193










More information about the TYPO3-dev mailing list