Bug #47922 [Opn->Fbk]: PDO_SQLITE: reopen database for each update query if no alive results exists

From: Date: Wed, 02 Sep 2015 02:18:04 +0000
Subject: Bug #47922 [Opn->Fbk]: PDO_SQLITE: reopen database for each update query if no alive results exists
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-195687@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=47922&edit=1 ID: 47922 Updated by: cmb@php.net Reported by: homm86 at gmail dot com Summary: PDO_SQLITE: reopen database for each update query if no alive results exists -Status: Open +Status: Feedback Type: Bug Package: PDO SQLite Operating System: * PHP Version: 5.2.9 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2009-04-08 08:00:56] homm86 at gmail dot com Description: ------------ Database begin slow down on simple queries, such as INSERT, UPDATE, DELETE. This is paradox, but sqlite slowdown updates when not alive results in memory presence. If we have alive result with non-zero count of elements, updates runs very fast. The only difference between two passages in example is unset($helper), but this gives more then 150x slowdown. I also notice hi disk usage while operation. I think driver in second pass reopen database for write. Reproduce code: --------------- http://pastebin.com/f595e2031 Expected result: ---------------- I want same time for both passages. Actual result: -------------- Results different on 150 times. 0.0336790084839 5.47776293755 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=47922&edit=1

« previous php.bugs (#195687) next »