当前位置:网站首页>Batch import of orange single micro service
Batch import of orange single micro service
2022-04-23 05:35:00 【pangluo00】

The above code is all generated automatically , Bulk import
If you configure this form , Batch import is supported , Then the code will generate , You won't .

For performance reasons , It can be stored locally , Of course, it can also be stored in minio etc. oss in

The orange list will generate some fields that need to be ignored , Like the Creator , Creation time , Updated by , Update time , Logical deletion, etc .
Comments are also given here , If you want to ignore other fields , You can also modify it directly here , Just one line .

If excel Order in , Not the order in the field , You can adjust it properly here .
From these two points, we can see , Modification is very simple . Secondary orange single , Deliberately did not consider the generation of 100% Code for , But it does reserve some space for secondary development to fill in the blanks . This makes it very easy to strike a balance . In terms of code quality , framework 、 Business and development efficiency . Very balanced .
If the excessive pursuit of code generation accounts for , Code quality and runtime efficiency will be greatly reduced .

The code comments generated here , The explanations are very clear , If you want to do dictionary translation of imported data , Just give this set Add the field name . It's simple .
such as ,excel What's in it gradeName, Such as “ second grade ”, This will translate into the corresponding id, such as :2, Then insert it into the original business table , This is the dictionary translation ability in batch import

In the actual imported code , Orange list has no simple use The ordinary way , Instead, this SAX Callback mode for , In this way, when there is too much imported data , It can not only accelerate the import efficiency , At the same time, it can save memory .

All data imported into memory will be , Verify the associated fields

Here is batch verification , These are the code generated by orange list , If it is generated by mistake , Can be modified directly , And remove .

These are data validation based on constant Dictionary

These are the verification of the dictionary table , These dictionary tables are physical data tables , But the data is in the cache , So it's more efficient .

These are the associations between ordinary business tables id Validation of the .
So in the orange list , These three categories id Verification is fully supported .
Constant class , Cached dictionary data , And the dictionary in the data table .
For performance , If so 10 10000 pieces of batch imported data , Yes 4 Such a field to be verified .
Then the number of verification is 40 Ten thousand times , This performance overhead is huge .
Orange single optimizes... In two ways , The first is that some dictionaries are redis cache , What's more, all validation is batch validation ,
For example, verify once 1000 strip , Then the number of operations on the database , It will be reduced a thousand times
If so, verify id Is based on redis Of , The number of accesses to the database will be halved .

The last step , It's batch insertion . Even this step , The code generated by orange order has also been optimized enough ,
The second parameter is -1, All tables are inserted in batch by default , This batch is real insert list That batch , It's not a cycle insert That fake batch .
If the second parameter is not -1, It's a specific number .
such as 10 Ten thousand data , It can't be one insert list Insert all , This is limited by database Syntax . And you can't be so reckless .
So we can set each insert list The number of data pieces of , such as 2000, that 10 Million data , Will be divided into 50 Insert... Times . And finally submit
This can effectively avoid the syntax restrictions of the database , At the same time, it will not bring huge pressure to the database instantaneously .
Okay , Batch import share here .
版权声明
本文为[pangluo00]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230532556772.html
边栏推荐
- Processus d'exécution du programme exécutable
- After NPM was upgraded, there was a lot of panic
- C# ,类库
- open3d材质设置参数分析
- Nécessité de précharger les cookies dans le sélénium
- Branch and loop statements
- 五一劳动节期间什么理财产品会有收益?
- The main difference between pointer and reference
- Output string in reverse order
- C语言——恶搞关机小程序
猜你喜欢

selenium预先加载cookie的必要性

Box collapse and margin collapse

弘玑微课堂 | Cyclone RPA之“灵活的数字员工”执行器

Branch and loop statements

Quick app bottom navigation bar

SQL语句简单优化

(十一)vscode代码格式化配置

Double click The jar package cannot run the solution

On the use of constant pointer and pointer constant -- exercise (record)

Camera imaging + homography transformation + camera calibration + stereo correction
随机推荐
catkin_ What did package do
修仙真实世界与游戏世界
Knowledge of egg testing -- mock, Supertest, coffee
弘玑|数字化时代下,HR如何进行自我变革和组织变革?
Create process memory management copy_ Mm - processes and threads (IX)
世界与个人发展
Markdown syntax support test
Nécessité de précharger les cookies dans le sélénium
The title bar will be pushed to coincide with the status bar
可执行程序执行流程
[machine learning] scikit learn introduction
qt. qpa. plugin: Could not find the Qt platform plugin “xcb“ in ““
Watch depth monitoring mode
SQL语句简单优化
Some pits used by uni
Hongji micro classroom | cyclone RPA's "flexible digital employee" actuator
3d slicer中拉直体的生成
Generation of straightening body in 3D slicer
CPT 104_ TTL 09
After NPM was upgraded, there was a lot of panic