问题描述
我有两张桌子(一张有 33k 行,另一个有 7k 行).我想比较两个表并删除两个 id 不匹配的行.但是当我发送查询时,它会冻结 phpmyadmin.桌子会不会太大了?
I got two tables (one with 33k rows and another with 7k rows). I want to compare the two tables and delete the rows in which the two id's dont match. But when i send off the query, it freezes phpmyadmin. Could the tables be too big?
SELECT * FROM likes LEFT OUTER JOIN uploads on likes.upload_id = uploads.upload_id WHERE uploads.upload_id IS NULL
我知道数据库要处理数百万的数据,所以我不确定错误在哪里.
I know databases are meant to handle millions of data, so i'm not sure where the error lies.
最好的问候,马蒂亚斯
推荐答案
我会做一个解释,这样你就可以看到 mysql 做了什么.这将很好地表明使用了多少行.
I would do an explain so you can see what mysql does. This would give a good indication on what how many rows are used.
EXPLAIN SELECT * FROM likes LEFT OUTER JOIN uploads on likes.upload_id = uploads.upload_id WHERE uploads.upload_id IS NULL
您还可以使用其他浏览器或其他会话来使用 show processlist 查看查询的执行方式.
you could also use another browser or another session to use show processlist to see how the query is executed.
这篇关于phpmyadmin 在查询时冻结,db 太大?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!