RDBMS : Move frequently updated columns into a separate table

ⅰ亾dé卋堺 提交于 2019-12-20 04:13:58

问题


I have a table Users (simplified) :

UserId (int, PK) | Username | PasswordHash | LastVisitTimestamp

Every time user visits a web site, LastVisitTimestamp column is updated.

Is it a good idea to move that column into a separate table, so that timestamp updates do not lock entire row (actual row is bigger than presented here).

I did that because I was frequently getting "row modified" exception when updating user information (result of update with optimistic concurrency).

Or is there a better (preferred) way to handle this?


回答1:


Yes, this is totally legit way of solving the problem.

Another ideas are storing such data in memory-based storage, accumulate and dump to database once per few seconds in batches...



来源:https://stackoverflow.com/questions/3868127/rdbms-move-frequently-updated-columns-into-a-separate-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!