title: Hibernate fetching quick if setMaxResults is set
body: <p>There is a simple sql query which fetches <strong>only ONE</strong> record. The database is oracle.</p>
  
  <p>Following is the simple query:</p>
  
  <pre><code>select *
  from APPEALCASE appealcase0_
  where appealcase0_.caseNumber='BAXXXXX00' and appealcase0_.DELETED_FLAG='N' 
  </code></pre>
  
  <p>When I fetch this row using hibernate the response time is <code>500ms</code> which is slow since it has to be really quick and withing 10ms. But when I set the <code>MaxResults</code> in the hibernate query object to 1(one) the response time improved to 15ms. 
  Though my issue is fixed I'm still puzzled how setting <code>MaxResults</code> to 1 improved the response time drastically. Can anyone explain me this?</p>