title: Limit 1 should be used with queryRow in Yii?
body: <p>I am usually using <code>queryRow</code> to get a single record. eg:-</p>
  
  <pre><code>$lastReport =  Yii::app()-&gt;db-&gt;createCommand(
      'SELECT * FROM report ORDER BY created DESC'
  )-&gt;queryRow();
  </code></pre>
  
  <p>I looked the MySQL log to know which query is used for it.</p>
  
  <pre><code>SELECT tbl_report.* FROM report ORDER BY created DESC
  </code></pre>
  
  <p>It seems that Yii is retrieving all the records from the table and return the first record.</p>
  
  <p>So I think we should use <code>LIMIT 1</code> whenever we are using <code>queryRow</code>. eg:-</p>
  
  <pre><code>$lastReport =  Yii::app()-&gt;db-&gt;createCommand(
      'SELECT * FROM report ORDER BY created DESC LIMIT 1'
  )-&gt;queryRow();
  </code></pre>
  
  <p>Since the <a href="http://www.yiiframework.com/doc/api/1.1/CDbCommand#queryRow-detail" rel="nofollow">queryRow</a> is returning "the first row (in terms of an array) of the query result", Yii should automatically add the limit. otherwise user will use this query to get a single record and that will cause to performance degradation.</p>
  
  <p>Is my understanding is correct or I missed something?</p>