5 Einträge, 1 Seite |
1
2
3
SELECT a.name FROM users a INNER JOIN sessions b ON a.name = b.name
SELECT b.name FROM sessions b INNER JOIN users b ON b.name = a.name
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mysql> EXPLAIN SELECT a.name FROM users a INNER JOIN sessions b ON a.name = b.name
+----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+
| 1 | SIMPLE | b | ALL | NULL | NULL | NULL | NULL | 8 | Using temporary; Using filesort |
| 1 | SIMPLE | a | eq_ref | PRIMARY | PRIMARY | 3 | users.b.user_id | 1 | Using where |
| 1 | SIMPLE | c | ref | usernummer,kombi | usernummer | 3 | users.a.id | 2 | Using index |
+----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+
3 rows in set (0.00 sec)
mysql> EXPLAIN SELECT b.name FROM sessions a INNER JOIN users b ON a.name = b.name
+----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+
| 1 | SIMPLE | a | ALL | NULL | NULL | NULL | NULL | 7 | Using temporary; Using filesort |
| 1 | SIMPLE | b | eq_ref | PRIMARY | PRIMARY | 3 | users.a.user_id | 1 | Using where |
| 1 | SIMPLE | c | ref | usernummer,kombi | usernummer | 3 | users.a.user_id | 2 | Using index |
+----+-------------+-------+--------+------------------+------------+---------+-----------------+------+---------------------------------+
3 rows in set (0.00 sec)
5 Einträge, 1 Seite |