New answers tagged application-design
I believe completely wiping out the data and doing an insert would be faster. As each update would require a DB scan to find the matching record and update it.
You have a lot of factors to weigh, but here's where I would start: Will the columns for FOO comments and BAR comments be exactly the same? Would you ever need to group all comments on both foos & bars, treated identically (e.g. would you ever need a database query to sort/filter/count both foo & bar comments by date/time)? How likely is BAR to ...
I would keep them separate. Although the details differ, your circumstance smells a lot like the One True Lookup Table antipattern. By combining you will have problems defining foreign keys (which parent to point at?), amongst other things. Indexing strategy will essentially be about spliting the combined table into its constituent parts. And so on... The ...
Top 50 recent answers are included