File tree 1 file changed +5
-0
lines changed
src/java/org/jivesoftware/openfire/archive
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,11 @@ private Collection<Conversation> databaseSearch(ArchiveSearch search) {
351
351
// rows we need returned. The syntax is LIMIT [rows] OFFSET [offset]
352
352
else if (DbConnectionManager .getDatabaseType () == DbConnectionManager .DatabaseType .postgresql ) {
353
353
query .append (" LIMIT " ).append (numResults ).append (" OFFSET " ).append (startIndex );
354
+ }
355
+ // SQL Server optimization: use the OFFSET command to tell the database how many
356
+ // rows we need returned. The syntax is OFFSET [offset] FETCH NEXT [rows] ROWS ONLY
357
+ else if (DbConnectionManager .getDatabaseType () == DbConnectionManager .DatabaseType .sqlserver ) {
358
+ query .append (" OFFSET " ).append (startIndex ).append (" ROWS FETCH NEXT " ).append (numResults ).append (" ROWS ONLY " );
354
359
}
355
360
}
356
361
You can’t perform that action at this time.
0 commit comments