Skip to content

Commit

Permalink
[db-manager] Query elapsed time include fetch time
Browse files Browse the repository at this point in the history
The values reported were always lower than
the actual time for query and fetch.

I guess that those values are useful when you
are testing queries and fine-tuning them,
so the actual value should include fetching
time.
  • Loading branch information
elpaso committed Oct 3, 2018
1 parent f4bc24c commit b8c21b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/db_manager/db_plugins/data_model.py
Expand Up @@ -192,9 +192,7 @@ def __init__(self, db, sql, parent=None):

t = QTime()
t.start()
c = self.db._execute(None, str(sql))
self._secs = t.elapsed() / 1000.0
del t
c = self.db._execute(None, sql)

self._affectedRows = 0
data = []
Expand All @@ -216,7 +214,9 @@ def __init__(self, db, sql, parent=None):
# commit before closing the cursor to make sure that the changes are stored
self.db._commit()
c.close()
self._secs = t.elapsed() / 1000.0
del c
del t

def secs(self):
return self._secs
Expand Down

0 comments on commit b8c21b0

Please sign in to comment.