I am using code igniter(PHP) n MYSQL .I am extracting huge amount of data (around 60 thousand records from XML) into my mysql database.Then i am trying to load this data onto my web pages.I am successfully inserting data into my database using insert batch method of code igniter .But when I try to retrieve these records,it takes ages to load and display on the web page.
The approach I am using to insert data:
$data = array(array('title' => 'My title' ,
'name' => 'My Name' ,
'date' => 'My date' ),
array('title' =>'Another title','name'=> 'Another Name','date' =>'Another date'));
$this->db->insert_batch('mytable', $data);
I am simply using select statement to retrieve records from single table.
My question :
How can I retrieve huge amount of records efficiently without having delays in page loading and display??
You should look into pagination unless there is a very good reason to display 60,000 records to the user in one go.
CodeIgniter provides a pagination class, see documentation for details on how to use it along with example code:
http://ellislab.com/codeigniter/user-guide/libraries/pagination.html
If you need more guidance on how to use this than provided by the documentation above, the following tutorial may help:
http://phpmaster.com/pagination-with-codeigniter/