My pager disappears when I use hook_views_pre_execute I need to modify a query of one view. So, I use the hook_views_pre_execute.
The query is modified but the pager disappears.
My question is why? Do I need to add more lines to hook to use to display the pager?

Code:

function view_format_render_views_pre_execute(&amp;$view) {

    if ($view-&gt;name == 'view_probe' &amp;&amp; $view-&gt;display['block_1']-&gt;display_title =='List of categories') {
        $tid = $view-&gt;args[0];
        $tids = array_keys(taxonomy_get_children($tid));
        $tids=implode(', ',$tids);

         $search = "node_data_field_formatos_colecc.field_formatos_colecc_value = %d";
            $search_new = "node_data_field_formatos_colecc.field_formatos_colecc_value IN ( ".$tids." )";   

            $query = &amp;$view-&gt;build_info['query'];
            $query = str_ireplace($search, $search_new, $query);    

            $view-&gt;build_info['query'] = $query;

        if (isset($tid) &amp;&amp; isset($arguments)) {

                $query = str_ireplace($search_new, '', $query); 
                $view-&gt;build_info['query'] = $query;
        }
    }
}
if query exec is too long (for pagination views must return total count of rows at all pages and correspond it to rows per page ) pagination not returned by views. 

nid of nodes returns from one table in database and this queries is very simple &amp; fast

another fields (cck, ubercart, stock) returned from another db tables and it can be too long. for this views just returns first page to prevent timeout