MySQL Forums
Forum List  »  Performance

Re: Another Using temporary; Using filesort performance problem
Posted by: Drew Tennenbaum
Date: December 07, 2015 07:39PM

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 |
+----+-------------+----------------+--------+--------------------+---------+---------+-----------------------------+----------+-------------+

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Another Using temporary; Using filesort performance problem
1089
December 07, 2015 07:39PM


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.