sql - is below mysql Query cause huge load on server -
hi have executed below query
select a.* table1 a, table2 b a.x!=b.x;
as server hang not able provide exact structure of both tables. server having huge load.
table1 has no indexes , table 2 has index on x.
i have explain output similar query.
select a.* table1 a, table2 b a.x!=b.x; +----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | | +----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+ | 1 | simple | b | | null | null | null | null | 70503 | | | 1 | simple | | eq_ref | email | email | 386 | asp_db.b.email | 1 | | +----+-------------+-------+--------+---------------+-------+---------+----------------+-------+-------+ 2 rows in set (0.00 sec)
please can 1 in regrading this...
table1 has 69264 rows , table2 has 3332349 rows , mysql query
think want select. far say: give me records of table1 , each of these records non-matching records of table2 (i.e. id not match). give hundreds of millions of rows.
Comments
Post a Comment