Good day.

The structure of the database is such that it is necessary to insert the data in four tables. About 20 lines in total, double-catch LAST_INSERT_ID() . The operation is infrequent. There are two options: either implement a transaction, or write data to temporary tables and call the stored procedure. The last option seems easier to me, less code in the application itself. But confuses that it will be implemented for small amounts of data. Please share your personal experience. Is the use of temporary tables for routine data insertion a normal practice, or is it more like a knee-stick approach to plugging holes in the design.

    1 answer 1

    Temporary tables are usually used for massive or nontrivial work with the database, in order to understand which way is better in your case - not enough information.

    In any case, if you still work with temporary tables, do not forget to use the memory engine.

    • Thank. Basically, I thought so. If it is relatively easy to do without a temporary table, then we need to do without it. - nk32