--- a/bench.py Mon Jul 04 17:52:42 2016 +0800
+++ b/bench.py Mon Jul 04 18:06:48 2016 +0800
conn = sqlite3.connect(DBPATH)
while len(todo) < maxrevs:
- count = conn.execute('SELECT COUNT(*) FROM results WHERE node = ?', (node,)).fetchone()[0]
+ 'SELECT COUNT(*) FROM results'
if count < len(MARKS) * len(('without cache', 'with cache')):
- 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
+ 'SELECT MIN(time), MAX(time) FROM results'
+ ' WHERE mark = ? AND cache = ?',
(mark, False)).fetchone()
- 'SELECT MIN(time), MAX(time) FROM results WHERE mark = ? AND cache = ?',
+ 'SELECT MIN(time), MAX(time) FROM results'
+ ' WHERE mark = ? AND cache = ?',
- 'CREATE INDEX IF NOT EXISTS idx_results_node ON results (node)')
+ 'CREATE INDEX IF NOT EXISTS idx_results_node'
- 'CREATE INDEX IF NOT EXISTS idx_results_limits ON results (mark, cache, node, time ASC)')
+ 'CREATE INDEX IF NOT EXISTS idx_results_limits'
+ ' ON results (mark, cache, node, time ASC)')
for cache in (False, True):
- 'SELECT time FROM results WHERE node = ? AND mark = ? AND cache = ?',
+ 'SELECT time FROM results'
+ ' WHERE node = ? AND mark = ? AND cache = ?',
(node, mark, cache)).fetchall()
oldtime = old[0][0] if old else None
- 'INSERT INTO results (node, mark, time, cache) VALUES (?, ?, ?, ?)',
+ 'INSERT INTO results (node, mark, time, cache)'
+ ' VALUES (?, ?, ?, ?)',
(node, mark, time, cache))
- 'UPDATE results SET time = ? WHERE node = ? AND mark = ? AND cache = ?',
+ 'UPDATE results SET time = ?'
+ ' WHERE node = ? AND mark = ? AND cache = ?',
(time, node, mark, cache))