In MySQL, temporary tables are automatically discarded when the database connection is closed. If you plan to leave your connection open after the stored procedure, your temporary table will exist on disk until that connection is closed. The performance implications depend on many factors, for example, how you set up temporary table storage on your server, the amount of data in the table, etc.
It is considered best practice to simply drop the temporary table as soon as you are done with it. Then you get rid of worries about these potential performance implications.
source share