惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
Lohrmann on Cybersecurity
S
Secure Thoughts
I
Intezer
Forbes - Security
Forbes - Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
H
Help Net Security
IT之家
IT之家
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
宝玉的分享
宝玉的分享
S
Securelist
T
The Exploit Database - CXSecurity.com
博客园 - 叶小钗
Security Latest
Security Latest
The Cloudflare Blog
Jina AI
Jina AI
T
Tenable Blog
J
Java Code Geeks
G
GRAHAM CLULEY
C
CERT Recently Published Vulnerability Notes
SecWiki News
SecWiki News
AI
AI
博客园 - 聂微东
S
Schneier on Security
博客园_首页
爱范儿
爱范儿
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 【当耐特】
T
Threatpost
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Announcements
Recent Announcements
W
WeLiveSecurity
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
T
Threat Research - Cisco Blogs
S
Security Affairs
T
Tor Project blog
T
Tailwind CSS Blog
N
News | PayPal Newsroom
C
CXSECURITY Database RSS Feed - CXSecurity.com
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
The Register - Security
The Register - Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security

博客园 - 大山008

若依导出excel时decimal数据千分位格式化 SpringBoot如何引入deepseek-多轮对话 EasyExcel实现百万级数据导入导出 SpringAMQP整合RabbitMQ使用 win11安装redis步骤详解 ftp与sftp工具类 stream流的一些常用用法 子类的toString方法如何打印父类的属性 MySQL常见的几种优化方案 关于若依AsyncFactory的一些思考,记录一下 Vue 路由跳转、路由传参、跳转区别、传值取值 MYSQL中substring_index()用法 MySQL之json数据操作 mybatis查询返回map键值对的问题 validate校验,记录一种思路 在vue中用multipart/form-data方式上传文件并同表单同步提交数据 Java微信转发及网络检测 生成带有二维码的海报 java将指定文件夹下面的所有图片压缩到指定大小以内并保存图片 Lock与ReentrantLock、Synchronized
mybatis sql 解决 in 参数过多的问题
大山008 · 2023-04-23 · via 博客园 - 大山008

in 语句超过1000报错问题

sql in 是用内层驱动外层,一般用在数据量比较小的时候,而且条件上有索引,也会走到索引。但是如果in里的参数过多,mysql可能会放弃走索引,进而进行全表扫描,影响效率。这种情况可以把in里的参数拆分,使得sql重新走上索引,多个结果走索引后再合并,也比全表扫描快。

<if test="xxxList != null and xxxList.size() > 0">
            and (表.字段 in
            <foreach collection="xxxList" item="item" index="index" open="(" close=")">
                <if test="index > 0">
                    <choose>
                        <!-- 每1000个拆分出一个or -->
                        <when test="(index % 1000) == 999">) OR 表.字段 in (</when>
                        <otherwise>,</otherwise>
                    </choose>
                </if>
                #{item}
            </foreach>
            )
        </if>
————————————————
版权声明:本文为CSDN博主「ZhaoJuFei」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/flyfeifei66/article/details/125788011