By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| version() |
|---|
| 8.0.23 |
| user_id | date_time | event_name | trivial |
|---|---|---|---|
| 002 | 2020-12-09 10:00:10 | C | 9 |
| 001 | 2020-12-10 10:00:00 | a | 1 |
| 001 | 2020-12-10 10:00:01 | b | 9 |
| 001 | 2020-12-10 10:00:02 | c | 3 |
| 002 | 2020-12-10 10:00:02 | A | 2 |
| 002 | 2020-12-10 10:00:09 | B | 4 |
| 001 | 2020-12-10 10:00:20 | d | 6 |
| 001 | 2020-12-10 10:00:40 | e | 2 |
| 002 | 2020-12-10 10:00:50 | D | 0 |
| user_id | date_time | event_name | trivial |
|---|---|---|---|
| 002 | 2020-12-10 10:00:02 | A | 2 |
| 002 | 2020-12-10 10:00:09 | B | 4 |
| 002 | 2020-12-10 10:00:50 | D | 0 |
| user_id | date_time | event_name | trivial |
|---|---|---|---|
| 002 | 2020-12-10 10:00:02 | A | 2 |
| 002 | 2020-12-10 10:00:09 | B | 4 |
| 002 | 2020-12-10 10:00:50 | D | 0 |
| user_id | date_time | event_name | trivial |
|---|---|---|---|
| 002 | 2020-12-10 10:00:02 | A | 2 |
| 002 | 2020-12-10 10:00:09 | B | 4 |
| 002 | 2020-12-10 10:00:50 | D | 0 |
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PRIMARY | t_left | null | ALL | null | null | null | null | 9 | 100.00 | Using temporary; Using filesort |
| 1 | PRIMARY | <derived2> | null | ALL | null | null | null | null | 1 | 100.00 | Using where; Using join buffer (hash join) |
| 2 | DERIVED | log_table | null | ALL | null | null | null | null | 9 | 100.00 | Using where |
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PRIMARY | <derived2> | null | system | null | null | null | null | 1 | 100.00 | Using filesort |
| 1 | PRIMARY | t_left | null | ALL | null | null | null | null | 9 | 11.11 | Using where |
| 2 | DERIVED | log_table | null | ALL | null | null | null | null | 9 | 100.00 | Using where |
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PRIMARY | <derived2> | null | system | null | null | null | null | 1 | 100.00 | Using temporary; Using filesort |
| 1 | PRIMARY | t_left | null | ALL | null | null | null | null | 9 | 100.00 | Using where |
| 2 | DERIVED | log_table | null | ALL | null | null | null | null | 9 | 100.00 | Using where |
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PRIMARY | <derived2> | null | system | null | null | null | null | 1 | 100.00 | Using filesort |
| 1 | PRIMARY | t_left | null | ALL | null | null | null | null | 9 | 11.11 | Using where |
| 2 | DERIVED | log_table | null | ALL | null | null | null | null | 9 | 100.00 | Using where |
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PRIMARY | t_left | null | ALL | null | null | null | null | 9 | 100.00 | Using temporary; Using filesort |
| 1 | PRIMARY | <derived2> | null | ALL | null | null | null | null | 1 | 100.00 | Using where; Using join buffer (hash join) |
| 2 | DERIVED | log_table | null | ALL | null | null | null | null | 9 | 100.00 | Using where |
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PRIMARY | <derived2> | null | system | null | null | null | null | 1 | 100.00 | Using filesort |
| 1 | PRIMARY | t_left | null | ref | user_id | user_id | 23 | const | 4 | 100.00 | Using where |
| 2 | DERIVED | log_table | null | ALL | null | null | null | null | 9 | 100.00 | Using where |
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PRIMARY | <derived2> | null | system | null | null | null | null | 1 | 100.00 | Using temporary; Using filesort |
| 1 | PRIMARY | t_left | null | ref | user_id | user_id | 23 | const | 4 | 100.00 | Using where |
| 2 | DERIVED | log_table | null | ALL | null | null | null | null | 9 | 100.00 | Using where |
| id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | PRIMARY | <derived2> | null | system | null | null | null | null | 1 | 100.00 | Using filesort |
| 1 | PRIMARY | t_left | null | ref | user_id | user_id | 23 | const | 4 | 100.00 | Using where |
| 2 | DERIVED | log_table | null | ALL | null | null | null | null | 9 | 100.00 | Using where |