在MySQL中是否存在着某种污点?
请允许我说,我们有一个桌子。
user | action | target
-----------------------
1 | likes | 14
2 | follows | 190
I don t want to store "action" as text, because it takes much space and is slow to index. Actions are likely to be limited (up to 50 actions, I guess) but can be added/removed in the future. So I would like to avoid storing all actions by numbers in PHP. I would like to have a table that handles this transparently.
For example, table above would be stored as (1,1,14), (2,2,190) internally, and keys would be stored in another table (1 = likes, 2 = follows).
INSERT INTO table (41, "likes", 153)
这里的“类似”已解决到1个。
INSERT INTO table (23, "dislikes", 1245)
在这里,我们对于在内部增加和储存“类似”没有任何关键。
可能吗?