dependant subquery processed despite Extra Impossible WHERE noticed after reading const tables in this query https://www.db-fiddle.com/f/snzSLd8y1oRNRqdsFpNdHa/0

SELECT test0.id,
(SELECT GROUP_CONCAT(test2.one_info) FROM test2 WHERE test2.one_id = test1.id) AS GC
FROM test0
INNER JOIN test1 ON test1.zero_id = test0.id
WHERE test0.id = 1 AND test1.id = 1 AND test1.rand = 5;


test1.rand=5 exists so the execution plan is

| id  | select_type        | table | partitions | type  | possible_keys | key     | key_len | ref   | rows | filtered | Extra       |
| --- | ------------------ | ----- | ---------- | ----- | ------------- | ------- | ------- | ----- | ---- | -------- | ----------- |
| 1   | PRIMARY            | test0 |            | const | PRIMARY       | PRIMARY | 4       | const | 1    | 100      | Using index |
| 1   | PRIMARY            | test1 |            | const | PRIMARY       | PRIMARY | 4       | const | 1    | 100      |             |
| 2   | DEPENDENT SUBQUERY | test2 |            | ref   | IND           | IND     | 5       | const | 4    | 100      | Using index |


but when i change it to something that does not exist like test1.rand=10 it give this exectuion plan

| id  | select_type        | table | partitions | type | possible_keys | key | key_len | ref   | rows | filtered | Extra                                               |
| --- | ------------------ | ----- | ---------- | ---- | ------------- | --- | ------- | ----- | ---- | -------- | --------------------------------------------------- |
| 1   | PRIMARY            |       |            |      |               |     |         |       |      |          | Impossible WHERE noticed after reading const tables |
| 2   | DEPENDENT SUBQUERY | test2 |            | ref  | IND           | IND | 5       | const | 4    | 100      | Using index                                         |


and despite Extra: Impossible WHERE noticed after reading const tables and it returning no results it still used select_type: DEPENDANT SUBQUERY and got rows: 4

how to fix this problem and make it not return anything at all to save performance?
Look at the Handler counts to see if it is actually touching any rows:  http://mysql.rjweb.org/doc.php/index_cookbook_mysql#handler_counts

And use EXPLAIN FORMAT=JSON SELECT ... to get more details.

Anyway, since it is a DEPENDENT subquery, it will be asked to run as often as needed.  But that is zero times.

Also, EXPLAIN, is not perfect.  The subquery did not get 4 rows; EXPLAIN is estimating that it will touch 4 rows each time it the subquery is invoked.  Again, 0*4 = 0.