PS 8.0 tmp_disk_tables broken in slow query log

Description

I have executed some query in 8.0.12 which creates an in memory temp table, this is what I got in the slow query log:

Comment:

1. Tmp_disk_tables is 1 here (notice Tmp_table_on_disk in the line below that one is "No" which is inconsistent) - it should be 0 here.
2. Tmp_table_sizes is 0 and I think it should be calculated regardless if temp table is created on disk or in memory.

Here's info from performance schema for this query:

CREATED_TMP_TABLES is 1, but CREATED_TMP_DISK_TABLES is 0

PS 5.7.23 with in memory temp table:

Tmp_disk_tables is 0 here, but Tmp_table_sizes is calculated which I think it should be (so 5.7 seems fine here).

PS 8.0.12 with on disk temp table:

You can see that Tmp_disk_tables is 1 here and Tmp_table_sizes is also calculated - so I would conclude that this affects only queries which create in memory temp tables.

Just for reference PS 5.7.23 with on disk temp table:

Also notice that upstream in 8.0.14 adds a new variable to control format of slow query log:

https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_log_slow_extra
https://dev.mysql.com/doc/refman/8.0/en/slow-query-log.html#slow-query-log-contents
and it will include some of the stuff that we already have and some more so this will be fun all around.

STEPS TO REPRODUCE:

Environment

None

Smart Checklist

Activity

Laurynas Biveinis December 17, 2018 at 2:44 PM

Zero Tmp_table_sizes split off to

roel.vandepaar December 7, 2018 at 11:26 AM

Understood. Happy for this ticket to remain "fix if time".

Laurynas Biveinis December 7, 2018 at 8:15 AM

I expect so

roel.vandepaar December 7, 2018 at 1:58 AM

do you expect that only stats/stats code are/is involved here?

Peter Schwaller November 27, 2018 at 1:22 PM

Fix if Time (8.0 triage meeting)

Done

Details

Assignee

Reporter

Time tracking

6h 31m logged

Fix versions

Affects versions

Priority

Smart Checklist

Created November 7, 2018 at 4:12 PM
Updated March 6, 2024 at 12:42 PM
Resolved December 18, 2018 at 5:26 PM