Why views retrieves results one by one I'm actually trying get the count of total rows retrieved by view. When I added count($row) in Global:PHP of views field it returned 1. That also ten times, Means query executed 10 times to retrieve 10 row of data. When I printed the query with dpq($view-&gt;build_info['query']); it returned same query 10 times. How can I avoid multiple execution of same query.
You can list the number of results instead with a snippet of php code in the header:

&lt;?php
  $view = views_get_current_view();
  print $view-&gt;total_rows; 
?&gt;


Learned this trick from: https://stackoverflow.com/a/2989197