Home > database >  Transaction-level temporary table and session level temporary table use occasion
Transaction-level temporary table and session level temporary table use occasion

Time:10-09

Such as topic, both the concept of the temporary table I understand, I now work in multi-purpose session temporary table, but I always don't understand the transaction level where the role of the temporary table, for example to insert a number of temporary data, directly after the insert query should be not! Not commit to check! But a submission has emptied, here don't understand all the time, is there any bosses to give directions, for best!

CodePudding user response:

1, first of all, both the temporary table is isolation between sessions, you insert data, only in the current session, two temporary table data from other session to find less than you are;
2, the difference of two kinds of temporary table is session when you commit, also can check to, and won't check it after you commit transaction level;
Level 3, the session is a temporary table scene is disconnected session data is clear, that is used during the whole session data in a temporary table; And transaction-level temporary table scene is transaction commit after the data is clear, also is to use temporary table data during the transaction,
  • Related