MySQL temporary vs memory table in stored procedures

前端 未结 5 1842
难免孤独
难免孤独 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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-14 21:47

    Of the two, I'd use a temporary table for report.

    A memory table holds data across user sessions & connections, so you'd have to truncate it every time to make sure you wouldn't be using data from someone else. Assuming you put in whats necessary to maintain a memory table depending on your needs, it's fine - the temp table is a little safer from a maintenance perspective.

提交回复
热议问题