1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Limit calculated rows to the number of rows in the table

The result file changes are mainly that number of rows is one smaller
for some queries with DISTINCT or GROUP BY
This commit is contained in:
Monty
2021-10-06 02:39:59 +03:00
committed by Sergei Petrunia
parent c443dbff0e
commit 87d4d7232c
12 changed files with 43 additions and 37 deletions

View File

@ -15,6 +15,6 @@ explain
SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 DERIVED t1 range NULL id 53 NULL 2 Using index for group-by
2 DERIVED t1 range NULL id 53 NULL 1 Using index for group-by
SET GLOBAL slow_query_log = @sql_tmp;
drop table t1;