MySQL temporary vs memory table in stored procedures

前端 未结 5 1849
难免孤独
难免孤独 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:54

    I Just wanted to point out that, in 2021 using MariaDB-10.3.27, the code @biziclop said doesn't work, is not the case any more, this is possible:

    CREATE TEMPORARY TABLE tmp1 AS
    SELECT * FROM products LIMIT 10;
    SELECT * FROM tmp1, tmp1 AS t2;
    

    (I just tested it)

提交回复
热议问题