speedup in case of keyed tables

This commit is contained in:
Michele Comitini
2013-07-09 09:07:37 +02:00
parent a7021bece2
commit dd7aff8136
+1 -4
View File
@@ -8386,10 +8386,7 @@ class Table(object):
elif isinstance(key, dict):
""" for keyed table """
query = self._build_query(key)
rows = self._db(query).select()
if rows:
return rows[0]
return None
return self._db(query).select(limitby=(0,1), orderby_on_limitby=False).first()
elif str(key).isdigit() or 'google' in DRIVERS and isinstance(key, Key):
return self._db(self._id == key).select(limitby=(0,1), orderby_on_limitby=False).first()
elif key: