Why is it there ????
bzr revid: ced-8e946c402962a6253c9f199537b7d1fa97ee1663
This commit is contained in:
@@ -57,38 +57,6 @@ class fake_cursor:
|
||||
self.con = con
|
||||
self.dbname = dbname
|
||||
|
||||
def execute(self,*args):
|
||||
#if not fake_cursor.nbr % 1:
|
||||
# print 'sql: ',fake_cursor.nbr, args
|
||||
res = re.match('^select.* from ([a-zA-Z_]+) .*$', args[0], re.I)
|
||||
if res:
|
||||
fake_cursor._tables.setdefault(res.group(1), 0)
|
||||
fake_cursor._tables[res.group(1)] += 1
|
||||
|
||||
#else:
|
||||
# if len(args)>1:
|
||||
# print 'sql: ',fake_cursor.nbr, args[0], args[1]
|
||||
# else:
|
||||
# print 'sql: ',fake_cursor.nbr, args[0]
|
||||
|
||||
if not fake_cursor.nbr % 500:
|
||||
ct = []
|
||||
for t,c in fake_cursor._tables.items():
|
||||
ct.append([c,t])
|
||||
ct.sort()
|
||||
ct.reverse()
|
||||
print 'After %d queries' % (fake_cursor.nbr,)
|
||||
for line in ct[:50]:
|
||||
print ' %s: %d' % (line[1], line[0])
|
||||
|
||||
#if len(args)>1:
|
||||
# print 'sql: ',fake_cursor.nbr, args[0], args[1]
|
||||
#else:
|
||||
# print 'sql: ',fake_cursor.nbr, args[0]
|
||||
|
||||
fake_cursor.nbr += 1
|
||||
return self.obj.execute(*args)
|
||||
|
||||
def execute(self, sql, params=None):
|
||||
if not params:
|
||||
params=()
|
||||
|
||||
Reference in New Issue
Block a user