开发者

mySQL vertical partitioning example

I have 5 tables: "tasks, projects, customers, users, activities" and these tables have ALL the same columns : "ID, UID, title, description, createdat, createdby, updatedat ...." plus some extra columns.

I would like to regroup all the common columns in the same table so I can list easily the last updates (like the fa开发者_如何学JAVAcebook wall for instance) ...

Is it a good idea ? Should I use views in order to simulate the JOIN stuff ? How can I implement the vertical partitionning stuff in this case ?


This sounds reasonable enough a suggestion to me.

There shouldn't be any harm in implementing simple views to make querying vs. specific tables easier, e.g. (please forgive the syntax if not quite right - and by all means use column names rather then *s!).

CREATE VIEW vw_Customers

AS

SELECT BT.*, C.*
FROM yourbasetable BT
INNER JOIN customers C
ON C.customerid = BT.ID
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜