Generate faster message range queries
This commit is contained in:
parent
d96a4adfe4
commit
828a85ea32
2 changed files with 2 additions and 2 deletions
|
@ -84,7 +84,7 @@ class MessageRange():
|
||||||
if self.min is not None and self.max is None:
|
if self.min is not None and self.max is None:
|
||||||
return "%s >= %d" % (column, self.min)
|
return "%s >= %d" % (column, self.min)
|
||||||
elif self.min is not None and self.max is not None:
|
elif self.min is not None and self.max is not None:
|
||||||
return "%s >= %d and %s <= %d" % (column, self.min, column, self.max)
|
return "%s between %d and %d" % (column, self.min, self.max)
|
||||||
elif self.min is None and self.max is not None:
|
elif self.min is None and self.max is not None:
|
||||||
return "%s <= %d" % (column, self.max)
|
return "%s <= %d" % (column, self.max)
|
||||||
|
|
||||||
|
|
|
@ -558,7 +558,7 @@ class Session(Connection):
|
||||||
and newsgroup_message.newsgroup_id = %s
|
and newsgroup_message.newsgroup_id = %s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
sql += " and " + msgrange.where('newsgroup_message.message_id')
|
sql += " and " + msgrange.where('message.id')
|
||||||
|
|
||||||
cr = self.db.query_sql(Message, sql, (self.newsgroup.id,))
|
cr = self.db.query_sql(Message, sql, (self.newsgroup.id,))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue