On Fri, December 15, 2006 7:49 am, Yonatan Ben-Nes wrote:
> 1. Let's say that I create the following prepared statement:
> $PDOStatement = $DB_Conn->prepare("INSERT INTO test (name) values
> (?)");
> And after 50,000 inserts (with
> $PDOStatement->execute(array('somevalue'));)
> I want the database to analyze, compile and optimize it's plan again
> so it
> will be more efficient for it's next inserts (actually is that true at
> all?!?), does repeating the same command will deallocate the prepared
> statement at the database & replace it with the new prepared
> statement? (new
> plan).
> If not, how can I deallocate it then?I *think* you will find that the change in plan for an insert will not change drastically as you insert -- Rather, the change in plan will change for a SELECT if you optimize/analyze/etc. Based on the $PDOStatement being a result object, I would *expect* it to survive an analysis query on the same connection, but you'll have to test to be sure. > 2. At the PHP manual of PDOStatement::closeCursor it's written that > "This > method is useful for database drivers that do not support executing a > PDOStatement object when a previously executed PDOStatement object > still has > unfetched rows. If your database driver suffers from this limitation, > the > problem may manifest itself in an out-of-sequence error.". > Anyone know if the PostgreSQL suffer from this problem or not? The PostgreSQL developers will probably answer this one way more faster. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

