gpt4 book ai didi

mysql - 低于mysql查询导致服务器负载巨大

转载 作者:行者123 更新时间:2023-11-29 13:06:43 24 4
gpt4 key购买 nike

您好,我已经执行了以下查询

select a.* from table1 a, table2 b where a.x!=b.x;

由于服务器挂起,我无法提供两个表的确切结构。服务器负载巨大。

表 1 没有索引,表 2 在 x 上有索引。

我已经解释了类似查询的输出。

select a.* from table1 a, table2 b where a.x!=b.x;
+----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+
| 1 | SIMPLE | b | ALL | NULL | NULL | NULL | NULL | 70503 | |
| 1 | SIMPLE | a | eq_ref | email | email | 386 | ASP_DB.b.email | 1 | |
+----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+
2 rows in set (0.00 sec)

请任何人帮忙重新评分...

table1有69264行,table2有3332349行,是mysql查询

最佳答案

考虑一下您想要选择什么。到目前为止,您说:给我 table1 的所有记录,以及 table2 中每条记录的所有不匹配记录(即 id 不匹配的地方)。这可能会为您提供数亿行。

关于mysql - 低于mysql查询导致服务器负载巨大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22606394/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com