What would be the best way to fetch around a million record from DB?

后端 未结 4 1427
小蘑菇
小蘑菇 2021-02-09 05:04

I need to fetch and show data on a webpage whose number of records may vary based on filters from around 500 records to 1 million records.

Will caching be of any use her

4条回答
  •  清歌不尽
    2021-02-09 05:22

    If your server can't cache 1 million records how do you think your user's web browser is going to handle 1 million records worth of HTML coming at it?

    Consider paging (here is an example with 1 million records)

    Also consider that the user never wants more than about 30 to 50 records. You are either showing them too low level of detail, or you need more filtering.

提交回复
热议问题