![](/img/trans.png)
[英]What is Best Practice for mapping a comment table to multiple tables in mysql?
[英]MYSQL -what is the best practice for checking if multiple phone numbers exist in table
我的表包含 500 万条电话号码。 假设我需要检查该表中是否存在特定的电话号码 - 我输入了 100 万个号码,并且需要检查我的表中存在哪些号码 - 结果必须在 20 秒以下 - 这个查询是什么?
为tableA的电话号码字段和tableB的字段创建索引
执行以下 SQL 脚本
select
tableA.phoneNumber,
....
from
tableA
where EXISTS(select * from tableB where tableA.phoneNumber=tableB.phoneNumber)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.