cvs: docweb /scripts notes_stats.php
[email protected] ("Nuno Lopes")
| Newsgroups | php.doc.web |
|---|---|
| Message-ID | <cvsnlopess1111769288@cvsserver> |
nlopess Fri Mar 25 11:48:08 2005 EDT
Modified files:
/docweb/scripts notes_stats.php
Log:
adding transactions to highly improve performance
remove the primary key and associated tricks
#testing in a moment...
http://cvs.php.net/diff.php/docweb/scripts/notes_stats.php?r1=1.7&r2=1.8&ty=u
Index: docweb/scripts/notes_stats.php
diff -u docweb/scripts/notes_stats.php:1.7 docweb/scripts/notes_stats.php:1.8
--- docweb/scripts/notes_stats.php:1.7 Wed Feb 9 13:26:09 2005
+++ docweb/scripts/notes_stats.php Fri Mar 25 11:48:06 2005
@@ -17,7 +17,7 @@
| Vincent Gevers <[email protected]> |
| Credits: Sean Coates <[email protected]> |
+----------------------------------------------------------------------+
-$Id: notes_stats.php,v 1.7 2005/02/09 18:26:09 nlopess Exp $
+$Id: notes_stats.php,v 1.8 2005/03/25 16:48:06 nlopess Exp $
*/
require_once '../build-ops.php';
@@ -97,7 +97,9 @@
// using $i to allow a fetching resume
$sql .= "UPDATE info SET last_article=$i, build_date=$last_update;";
+sqlite_query($sqlite, 'BEGIN TRANSACTION');
sqlite_query($sqlite, $sql);
+sqlite_query($sqlite, 'COMMIT TRANSACTION');
sqlite_close($sqlite);
@@ -157,7 +159,7 @@
);
CREATE TABLE notes (
- note INTEGER PRIMARY KEY,
+ note INTEGER,
action TEXT,
manpage TEXT,
who TEXT,
@@ -175,7 +177,7 @@
/* makes a sql insert statment from an array */
function make_sql($array) {
array_shift($array);
- return 'INSERT OR IGNORE INTO notes VALUES ("' . implode('", "', $array) . '");';
+ return 'INSERT INTO notes VALUES ("' . implode('", "', $array) . '");';
}
?>