Run query after page load
hope this will help 

/**
 * Post process any rendered data.
 *
 * This can be valuable to be able to cache a view and still have some level of
 * dynamic output. In an ideal world, the actual output will include HTML
 * comment based tokens, and then the post process can replace those tokens.
 *
 * Example usage. If it is known that the view is a node view and that the
 * primary field will be a nid, you can do something like this:
 *
 * &lt;!--post-FIELD-NID--&gt;
 *
 * And then in the post render, create an array with the text that should
 * go there:
 *
 * strtr($output, array('&lt;!--post-FIELD-1--&gt;' =&gt; 'output for FIELD of nid 1');
 *
 * All of the cached result data will be available in $view-&gt;result, as well,
 * so all ids used in the query should be discoverable.
 *
 * This hook can be utilized by themes.
 * @param $view
 *   The view object about to be processed.
 * @param $output
 *   A flat string with the rendered output of the view.
 * @param $cache
 *   The cache settings.
 */
hook_views_post_render(&amp;$view, &amp;$output, &amp;$cache)
    { 
if ($view-&gt;name == 'your_view_name') 
    {
   //do your logic
   }}