← Back to team overview

zeitgeist team mailing list archive

Re: [Merge] lp:~zeitgeist/zeitgeist/explain-logs into lp:zeitgeist

 

I'm not sure, but maybe the queries are more readable if we replace '?' by the actual values:


=== modified file '_zeitgeist/engine/sql.py'
--- _zeitgeist/engine/sql.py    2010-09-13 20:55:00 +0000
+++ _zeitgeist/engine/sql.py    2010-09-14 07:40:46 +0000
@@ -38,9 +38,11 @@
 
 def explain_query(cursor, statement, arguments=()):
        log.debug("**********************************************")
-       log.debug("QUERY:\n%s (%s)\nPLAN:" % (statement,arguments))
+       plan = ""
        for r in cursor.execute("EXPLAIN QUERY PLAN "+statement, arguments).fetchall():
-               print r
+               plan += str(list(r)) + "\n"
+       statement = statement.replace("?", "%r") %tuple(arguments)
+       log.debug("QUERY:\n%s\nPLAN:\n%s" % (statement, plan))
        log.debug("**********************************************")
 
 class UnicodeCursor(sqlite3.Cursor):


But still, we can always adjust this in lp:zeitgeist itself, as it is for internal use only.
-- 
https://code.launchpad.net/~zeitgeist/zeitgeist/explain-logs/+merge/35334
Your team Zeitgeist Framework Team is subscribed to branch lp:~zeitgeist/zeitgeist/explain-logs.



References