How to optimize the pagination query?
Perhaps you could wrap it all in a function:

function pagination($this,$viewList,$keywordQuery)
{
    $this-&gt;paginate    = array(
        'fields'    =&gt;  array(
                        'DISTINCT Contact.contact_id',
                        'Contact.first_name',
                        'Contact.last_name',
                        'Contact.email',
                        'Contact.created',
                        'ContactGroup.name',
                      ),  
        'conditions' =&gt; array(
                        $this-&gt;conditions,
                        'ContactsContactGroup.contact_group_id'=&gt;$viewList,                        
                        isset($keywordQuery)?$keywordQuery:"",
                      ),      
        'limit'      =&gt; 5,
         'group'     =&gt; array('Contact.contact_id')
                      );

   return $this-&gt;paginate('ContactsContactGroup');

}

if(something())
{
    //something
    $data=pagination($this,$viewList,$keywordQuery);
}
else
{
    //other
    $data=pagination($that,$viewList,$keywordQuery);
}


etc..