0

I have a table with several fields, this table almost never change but for one field, "version" which change very often.

Would it be relevant to put that single field into a separate table in order to reduce how often locks are put on the main table?

For instance I have a table tType and a table tEntry. Whenever I add/deleted/update any row of tEntry, I need to update the "version" field of tType. There might be thousand of rows inside tEntry for a single tType referenced row. Meaning the version number could change very often, though any other data of tType (such as name, id, etc.) doesn't change.

Serge Profafilecebook
  • 1,165
  • 1
  • 14
  • 32

1 Answers1

1

Your Referral to tType and tEntry sounds like you are implementing a key-value store in a rdbms. There are several discussions you can google about this topic. In the www there seems to be consesus, that cons overweight pros on that. An option would be to look at key value stores, no sql, multi column DBs, etc (wikipedia)...

The next "anti-pattern" I recognized is that you try to mix transactional data with 'master data' in the table tType. Try to avoid this, even if your selects get more uncomfortable and need to be tuned better. Keep off the version info from the tType, if this changes extremely often. Look here to get the concept: MySQL JOIN the most recent row only?

Community
  • 1
  • 1
Quicker
  • 1,247
  • 8
  • 16