简体   繁体   English

在 angular 或 type 脚本中迭代数百万条记录的最佳方法是什么

[英]What is best way to iterate millions of records in angular or type script

Need to load multiple multi select drop-down with cascading effect that are related.需要加载多个具有相关级联效果的多选下拉菜单。

I have millions of records coming from API that are duplicate in some column but unique if we consider all columns.我有数百万条来自 API 的记录,这些记录在某些列中是重复的,但如果我们考虑所有列,则它们是唯一的。

Need to fill 10-12 multi-select drop-down with API data.需要用 API 数据填充 10-12 个多选下拉列表。 And In on-change event of drop-down I need to apply cascading effect by iterating millions of records.并且在下拉的 on-change 事件中,我需要通过迭代数百万条记录来应用级联效果。

What is best way to solve this kind of problem.解决此类问题的最佳方法是什么。

you shouldn't do this on the frontend side it's impossible to be efficient.你不应该在前端这样做,因为它不可能高效。

  • retrieval of millions of records by one API call will be very slow通过一次 API 调用检索数百万条记录将非常缓慢
  • Loading all this data in one page will make the page very slow and use much memory.在一页中加载所有这些数据会使页面非常缓慢并占用大量内存。 and you won't be able to do operations on it.并且您将无法对其进行操作。

So it's needed to be changed from the API side to use pagination or to query only the needed part of data on change by sending a new API request所以需要从 API 端改成使用分页或者通过发送新的 API 请求只查询需要的部分数据变化

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM