mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add oracle paging optimization discussed in issue 99
This commit is contained in:
parent
38d0a222e2
commit
78977c9c5f
2 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ module Arel
|
|||
SELECT raw_sql_.*, rownum raw_rnum_
|
||||
FROM (#{sql}) raw_sql_
|
||||
)
|
||||
WHERE raw_rnum_ between #{offset.expr.to_i + 1 } and #{offset.expr.to_i + limit}
|
||||
WHERE raw_rnum_ >= #{offset.expr.to_i + 1 } and rownum <= #{limit}
|
||||
eosql
|
||||
end
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ module Arel
|
|||
SELECT raw_sql_.*, rownum raw_rnum_
|
||||
FROM (SELECT) raw_sql_
|
||||
)
|
||||
WHERE raw_rnum_ between 11 and 20
|
||||
WHERE raw_rnum_ >= 11 and rownum <= 10
|
||||
}
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue