Overkill to add last_modified column to all tables?

When developing database tables for a new new project, is it recommended to add the last_modified column, which is automatically updated, for each table?

Is the performance successful for automatically updating the latest_modified columns to make it useful?

There may be several uses in this column, one of which will help with caching. But is it too easy to throw such a column on every table?

Also, are there other useful reasons to have a last_modified column?

This applies to MySQL , as it is the only system I use.

+3
source share
4 answers

It depends!

Do you need to know the last_modified date for each table? If yes, then you need this column.

Build a domain and then worry about performance, UNLESS , you know that you will have an insane amount of INSERTS / UPDATES in this table ...

+2
source

I found this to be a particularly disturbing piece of information. I receive only when the record was changed, but not what was changed, or by whom or why, or how.

I prefer to have audit tables for my important tables.

+2
source

?

. , , (, -). . Raj More, , , . , , .

, (, ), . ?

+1
source

Well, I would say that you should have this column for tables in which records often change by some kind of user action. And on top of that, if you have authentication, it’s useful to keep who made the changes. It can also save you some grief when someone comes to you with a question who made some changes to the record because something is broken.

0
source

Source: https://habr.com/ru/post/1720793/


All Articles