|
Overview of how this can be achieved:
Create a Work_table_tracker class.
- A Work_table_tracker object will store information about how the temp. table was used.
= its storage engine
= its #rows
= its size-on-storage-media
- It will have setter-like methods for reporting information about the temp table.
- (TODO: how does this work with parts of the query plan that are re-executed multiple times?)
Some data structure will keep a pointer to Work_table_tracker so that free_tmp_table() can call the reporting methods.
"Explain data structures" also need pointers to Work_table_tracker objects so that they can print them in the ANALYZE FORMAT=JSON output.
|