Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to display 1 million data from a table on UI

I have a question which might be a very common issue when data increases If I am having a table containing 1 million rows and I want to display it on my browser.

What is the most efficient approach / technique to approach this problem

I assume there should be a concept of pagination or load data as and when the user scrolls down to see more data, but how to hold 1 million data in memory until then, unless I query the table like id>x and id<(x+500) to fetch data in batches of 500..

Kindly share an efficient approach

Thanks

like image 373
Argho Chatterjee Avatar asked Jan 19 '26 16:01

Argho Chatterjee


1 Answers

You really don't want a resultset with 1000000 rows. Even if you paginated it, no-one's going sit down and read them all. Just put a limit on (say 1000), put a message on the page saying the results are truncated to 1000 rows, and offer filtering.

like image 88
NickJ Avatar answered Jan 21 '26 04:01

NickJ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!