Is a 'blackhole' table evil?

后端 未结 8 552
一生所求
一生所求 2021-01-01 16:09

Reading to this question i\'ve just learned the existence of the blackhole table trick: basically consist in using a single table to insert data, and then a tri

相关标签:
8条回答
  • 2021-01-01 17:05

    Each time you insert a row into a table, the odds are that you are writing to the same area of the hard drive or the same page (in MS-SQL world, I don't know about postgresql), so this technique will likely lead to contention and locking as all transactions are now competing to write to the same table.

    Also this will halve insert performance since inserts require two inserts instead of one.

    And this is denormalization since there are now two copies of the data instead of one.

    0 讨论(0)
  • 2021-01-01 17:10

    This doesn't look like a good idea. If you're trying to keep the front end code simple, why not just use a stored procedure? If it's not to keep the front end code simple, I don't understand the point at all.

    0 讨论(0)
提交回复
热议问题