title: MyBatis RowBounds vs Oracle pagination query using rownum and nested subquery
body: <p>I want to know which of the below performs better in terms of time to execute query with 100k+ records </p>
  
  <p><strong>1) Oracle's Pagination</strong> </p>
  
  <pre><code>SELECT *
  FROM  (
     SELECT id, col1, col2, rownum rn
     FROM (
        SELECT /*+ first_rows(50) */ id, col1, col2
        FROM   table1
        ORDER  BY id DESC
     )
     WHERE   rownum &lt;= 50
  )
  WHERE  rn &gt;= 20;
  </code></pre>
  
  <p><strong>2) Pagination using MyBatis RowBounds</strong>.</p>
  
  <p>MyBatis RowBounds uses normal JDBC and after firing the select it skips the first 20 records and then fetches the next 30 (pagesize).</p>
  
  <p>Also, will the MyBatis approach become slower as the page number increases as more rows needs to be skipped?</p>