Order sendable messages by timestamp. Also fixed some comments.

This commit is contained in:
akwizgran
2011-09-07 15:55:03 +01:00
parent bbf957cc94
commit 39be97a4d6
5 changed files with 10 additions and 12 deletions

View File

@@ -1144,8 +1144,8 @@ abstract class JdbcDatabase implements Database<Connection> {
+ " AND visibilities.contactId = ?"
+ " AND statuses.contactId = ?"
+ " AND timestamp >= start"
+ " AND status = ? AND sendability > ZERO()";
// FIXME: Investigate the performance impact of "ORDER BY timestamp"
+ " AND status = ? AND sendability > ZERO()"
+ " ORDER BY timestamp";
ps = txn.prepareStatement(sql);
ps.setInt(1, c.getInt());
ps.setInt(2, c.getInt());
@@ -1162,11 +1162,9 @@ abstract class JdbcDatabase implements Database<Connection> {
}
rs.close();
ps.close();
if(!ids.isEmpty()) {
if(LOG.isLoggable(Level.FINE))
LOG.fine(ids.size() + " sendable messages, " + total
+ " bytes");
}
if(LOG.isLoggable(Level.FINE))
LOG.fine(ids.size() + " sendable messages, " + total + "/" +
capacity + " bytes");
return ids;
} catch(SQLException e) {
tryToClose(rs);