Re: Another Using temporary; Using filesort performance problem
Discovered a straight_join which fixes the problem. I still don't understand why it needed to sort my production_dim table. I would have thought MySQL would just find the pr_production_id in my index and move on with the rest of the rows in schedule_dim.
mysql> explain SELECT sch_id
FROM schedule_dim s
STRAIGHT_JOIN production_dim ON pr_production_id = sch_production_did
group by sch_id order by sch_id;
+----+-------------+----------------+--------+--------------------+---------+---------+-----------------------------+----------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+----------------+--------+--------------------+---------+---------+-----------------------------+----------+-------------+
| 1 | SIMPLE | s | index | sch_production_did | PRIMARY | 4 | NULL | 28389421 | NULL |
| 1 | SIMPLE | production_dim | eq_ref | PRIMARY | PRIMARY | 4 | public.s.sch_production_did | 1 | Using index |
+----+-------------+----------------+--------+--------------------+---------+---------+-----------------------------+----------+-------------+
Subject
Views
Written By
Posted
2274
December 07, 2015 06:37PM
Re: Another Using temporary; Using filesort performance problem
1141
December 07, 2015 07:39PM
963
December 08, 2015 08:52PM
1187
December 09, 2015 10:31AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.