The below answer is my own suggestions that I gave as an answer.
In practical there is no need of pull million of records at one call. Instead of that we can show 10 or 100 of records in the web page with pagination. To pull the records from Database, just write a stored procedure it will also contains the pagination logic. That is, if the second page clicked, the stored procedure pull the rows from 101 to 200.
The above method consist 2 advantage:
1) Increased performance (only we pull and show 100 records).
2) Faster retrieval.