是否将last

编程入门 行业动态 更新时间:2024-10-25 16:24:30
是否将last_modified列添加到所有表中?(Overkill to add last_modified column to all tables?)

在为新项目设计数据库表时,为每个表添加一个自动更新的last_modified列是一种好习惯吗?

性能是否因为自动更新last_modified列太多而不值得?

此列可能有许多用途,一个用于辅助缓存。 但是,将这样一个列放入每个表中是否过度杀伤?

另外 - 有一个last_modified列还有其他有用的理由吗?

这是MySQL特有的,因为它是我使用的唯一系统。

When designing database tables for a fresh new project, is it good practice to add a last_modified column, which auto-updates, for every table?

Is the performance hit to have auto-updating last_modified columns too much to make it worthwhile?

This column could have a number of uses, one being to aid with caching. But is it overkill to just throw such a column into every table?

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

This is specific to MySQL, as it's the only system I use.

最满意答案

这取决于!

你需要知道每个表的last_modified日期吗? 如果是这样,那么您需要该列。

迎合领域,然后担心性能, 除非你知道你将在那张桌子上有一些疯狂的INSERTS / UPDATES ......

It depends!

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

Cater for the domain, and then worry about performance, UNLESS you know that you will have an insane number of INSERTS/UPDATES on that table...

更多推荐

last_modified,column,电脑培训,计算机培训,IT培训"/> <meta name="descript

本文发布于:2023-08-01 10:33:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1357730.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!