RE: [PEAR-DEV] Prepared Queries as PEAR Standard?
| From: | Lukas Smith | Date: | Mon, 17 Mar 2003 09:31:15 +0000 |
| Subject: | RE: [PEAR-DEV] Prepared Queries as PEAR Standard? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-14353@lists.php.net to get a copy of this message | ||
> From: Michael Tucek [mailto:michael.tucek@vienna.at]
> Sent: Monday, March 17, 2003 3:25 AM
> To: pear-dev@lists.php.net
> Subject: [PEAR-DEV] Prepared Queries as PEAR Standard?
>
> Hi,
>
> I'm new to the mailinglist, and I'm using some PEAR components for my
> diploma project and some private projects...
> I saw that most packages aren't using prepared SQL queries, so I
wonder
> why?
> Sice the PEAR::DB class supports prepare-execute emulation for dbs not
> supporting this feature (right?)...
Well prepared queries have their advantages. But the biggest
disadvantage is that they need to be emulated in mysql. However this is
the most used combination. But even in other RDBMS they are not really
ideal if you perform a query only once. However if you perform a query
multiple times and the RDBMS natively supports them you get a
performance gain.
For these reasons I don't think it's a good idea to use prepared queries
all too much for now.
Actually in PEAR DB a lot of the methods support prepared queries and I
guess that is mainly for the advantage of being able to pass the data
separate of the query to the method, which improves readability and
reduces typing. I still don't think it is wise to jump on prepared
queries as the primary solution. Also they do have one minor
disadvantage though, they are slightly more complicated to debug.
FYI: I know that the mysql people are working on prepared queries.
Regards,
Lukas