当前位置:网站首页>Optimize the query (work in progress)
Optimize the query (work in progress)
2022-08-03 22:03:00 【penguin that wants to fly】
Scenario: Double-table joint query cannot be used, only by querying a single table, the query result can be used as the query condition of the second table.
Solution: First of all, it must be clear that java establishes query connections with the database many times, and the query will consume a lot of time. What optimization needs to be done is to reduce the time, so that the number of times that java establishes a connection with the database for query can be reduced.time.
Idea 1 (unoptimized): traverse the found data in Table 1, obtain the attributes required by the corresponding Table 2 during the traversal, and directly query it in Table 2 to obtain the results of Table 2 until the traversal ends.
Idea 2 (optimization): Find the data in Table 1, then put the data in Table 1 that needs to be used in Table 2 into the collection, and then query in Table 2 according to the data in the collection, and then inFilter the found data according to the conditional attributes to get the desired data.
It may be a bit laborious to say this, but the idea of optimization is to reduce the number of connections to the database, because this connection is time-consuming. Through the algorithm, the data range is too large by reducing the number of connections before.desired data.
边栏推荐
猜你喜欢
随机推荐
1 秒完成授权,Authing 全新上线一键登录功能
Cisco ike2 IPSec配置
中国企业构建边缘计算解决方案的最佳实践
StoneDB 助力 2022 开放原子全球开源峰会
老板:公司系统太多,能不能实现账号互通?
HCIP第十五天
E - Swap
XSS practice - cycle and two cycle problem at a time
一体化HTAP数据库如此难,为什么他们还要做?
CAS:908007-17-0_Biotin-azide_Biotin azide
Security Fundamentals 8 --- XSS
Pay from 0 to 1
Cross-end development technical reserve record
CAS:153162-70-0_N-BOC-6-Biotinamidohexylamine
D - Project Planning--二分
互联网用户账号信息管理规定今起施行:必须严打账号买卖灰产
2022年全国职业院校技能大赛网络安全 B模块 B-1任务一:主机发现与信息收集 国赛原题
IO线程进程->线程同步互斥机制->day6
软件测试人员必备的60个测试工具清单,建议收藏一波~
start with connect by 实现递归查询
![[3D检测系列-PV-RCNN] PV-RCNN论文详解、PV-RCNN代码复现、包含官网PV-RCNN预训练权重及报错问题](/img/81/c929864440dc36238b3cb1deb9f112.png)








