title: Optimizing pagination query with Seek Method
body: <p>This seems to be a very common question but did not get the solution for all the cases.</p>
  
  <p>I have searched lots of articles to optimize the pagination query in MYSQL, I found the <a href="https://blog.jooq.org/2013/10/26/faster-sql-paging-with-jooq-using-the-seek-method/" rel="nofollow noreferrer">Seek Method</a> as the best solution.</p>
  
  <p>But in every example of seek method, I found that order by clause on either number or date type fields, What if we are ordering by a varchar type column(eg: first_name)  which may contain blank and null values too, I tried (first_name, id) &lt; (null, 15) AND (first_name, id) &lt; ('', 15) which show uncertain result.</p>
  
  <p>Please suggest how can we handle these cases too in seek method.</p>