aşağıdaki kodları kullanan ücretsiz bir script var elimde. listeleme çok yavaş oluyor bu kodlama yapısına uygun olarak hızlı ve değişik şekillerde nasıl kullanabilirim. fazla iyi sayılmam yardım eder örnek olarak verirseniz memnun olurum teşekkürler.

    public function get_last($limit)
    {
        return $this->db->select('h.*')
                        ->select('c.city_name, c.city_slug')
                        ->select('p.state_name, p.state_slug')
                        ->select('ca.title as category_title, ca.slug as category_slug, ca.image as category_image')
                        ->select('up.name as user_name, u.email as user_email')
                        ->select('COUNT(pr.company_id) as products')
                        ->from($this->_table . ' as h')
                        ->join($this->_table_state_cities . ' as c', 'h.city_id = c.city_id', 'left')
                        ->join($this->_table_state . ' as p', 'h.state_id = p.state_id', 'left')
                        ->join($this->_table_relations . ' as r', 'h.id = r.company_id', 'left')
                        ->join($this->_table_categories . ' as ca', 'ca.id = r.category_id', 'left')
                        ->join($this->_table_users . ' as u', 'h.user = u.id', 'left')
                        ->join($this->_table_user_profiles . ' as up', 'h.user = up.user_id', 'left')
                        ->join($this->_table_products . ' as pr', 'h.id = pr.company_id', 'left')
                        ->where('date <', date('Y-m-d H:i:s'))
                        ->where('h.status', 'published')
                        ->order_by('created_at', 'desc')
                        ->group_by('h.id')
                        ->limit($limit)
                        ->get()
                        ->result_array();
    }