[MDEV-17805] Do not add temporary tables to dict_sys->table_hash Created: 2018-11-22 Updated: 2023-12-22 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Temporary, Storage Engine - InnoDB |
| Fix Version/s: | 11.5 |
| Type: | Task | Priority: | Major |
| Reporter: | Marko Mäkelä | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | performance, temporary | ||
| Attachments: |
|
||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
InnoDB is adding both persistent and temporary tables to a dict_sys->table_hash, which maps table names to dict_table_t. We should only add persistent tables to the hash table, and we should not store any dict_table_t::name for temporary tables. It would be nice to store the user-specified table name instead of some #sql name, but RENAME TABLE is not being propagated to temporary tables. The reason why we currently need the table name lookup is that handler::delete_table() can be invoked on temporary tables without prior handler::open(), so the only information that is available is the table name. For persistent tables, we will need both name and ID based lookups for the time being. (InnoDB rollback and purge will look up tables by ID, and the SQL layer will have to look up persistent tables by name.) As part of this task, please ensure that the table name printed in errors will be the real table name, not the temporary table name: |
| Comments |
| Comment by Marko Mäkelä [ 2018-11-22 ] |
|
svoj provided an untested MDEV-17805-wip.patch |
| Comment by Marko Mäkelä [ 2018-11-23 ] |
|
We should also remove the global dict_sys->temp_id_hash that was introduced in |
| Comment by Marko Mäkelä [ 2018-12-18 ] |
|
I pushed an initial, non-working version of this to the 10.4-MDEV-17805 branch. svoj, could you help debugging it? |
| Comment by Sergey Vojtovich [ 2019-02-06 ] |
|
serg, please review 5 top patches in bb-10.4-svoj-MDEV17805. |
| Comment by Sergei Golubchik [ 2023-04-20 ] |
|
marko what are user visible effects of this change? |
| Comment by Marko Mäkelä [ 2023-08-21 ] |
|
serg, there should be no user visible effect of fixing this performance bug, other than the improved performance thanks to the removal of some shared data structures. I believe that the bug |