I have tweaked my server variables so that
SELECT BENCHMARK(1000000,1+1);
runs in 0.04 seconds (down from 0.1), but the following query still runs slow.
Both referenced tables have a key, but when I use EXPLAIN I get the following:
Is it possible to optimise this query? If so, what can I do different? I don't know if it's even possible to optimise a left outer join query, especially one that takes in so many rows.
SELECT BENCHMARK(1000000,1+1);
runs in 0.04 seconds (down from 0.1), but the following query still runs slow.
Code:
SELECT quote_vars.variable
FROM quote_vars
LEFT OUTER JOIN quote_desc
ON quote_vars.variable = quote_desc.variable
AND quote_id = 2226
WHERE value IS NULL;
Both referenced tables have a key, but when I use EXPLAIN I get the following:
Code:
+----+-------------+------------+------+---------------+------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+------+---------------+------+---------+------+-------+-------------+
| 1 | SIMPLE | quote_vars | ALL | NULL | NULL | NULL | NULL | 22 | |
| 1 | SIMPLE | quote_desc | ALL | NULL | NULL | NULL | NULL | 43670 | Using where |
+----+-------------+------------+------+---------------+------+---------+------+-------+-------------+
Is it possible to optimise this query? If so, what can I do different? I don't know if it's even possible to optimise a left outer join query, especially one that takes in so many rows.