MySQL temporary vs memory table in stored procedures

前端 未结 5 1841
难免孤独
难免孤独 2021-02-14 21:05

What\'s is better to use in a stored procedure: a temporary table or a memory table?

The table is used to stored summary data for reports.

Are there any trade o

5条回答
  •  走了就别回头了
    2021-02-14 21:45

    A temporary table will only exist for the duration of your session. A table declared with Engine=Memory will persist across user sessions / connections but will only exist in the lifetime of the MySQL instance. So if MySQL gets restarted the table goes away.

提交回复
热议问题