Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li>Keep it simple and extendible</li> <li>Don't let translation overhead affect performance, translation only needs to be done for output purposes.</li> </ol> <p>Suggestion:</p> <pre><code> LogId DateTime Action Role Entity e.g. 30303 1/1/10 43 Sender John 30303 1/1/10 43 Receiver Sam 30304 1/1/10 44 Game game43 30304 1/1/10 44 Player Sue 30304 1/1/10 44 Player Mike </code></pre> <p>(In the above table, "Message", ,"Sender", "John", "game43" etc. would not be text but would be foreign keys in either the action, role, or entity table. I've written the keys for "Action" but not for "Role" or "Entity" but they would be keys as well.</p> <p>Now, instead of text action, Role, Entity you might have keys in there, and store them in a separate table. This can be used for output, e.g.</p> <pre><code> Action Table Id ActionKey Text Language 1 43 JoinGame English 2 43 Jeu French 3 44 Message English ... ... Role Table Id RoleKey Text Language 1 1 Sender English 2 1 Sendeur French (I don't know french :) .... Entity Table EntityKey Text 1 Sam 2 game43 3 Sam </code></pre> <p>Note that in the entity table, 2 or more entries might have the same text representation, as there could be more than 1 user named Sam. If you want to represent different, orthogonal information about each entity, then you can include the EntityKey in the correspondig table, e.g.</p> <pre><code>Person Table Id EntityKey FirstName LastName .... 1 1 Sam Johnson Game Instance Table Id EntityKey GameType 1 2 444 Game Table Id Name MaxPlayers ... 444 Quake 10 </code></pre> <p>Basically we are mapping a predicate (in the first-order predicate logic sense, a set of tuples) to binary relation form (by creating an artificial entity, the action key). Thus, the Entity table basically contains various columns/arguments of the relation, and so it can be practically anything which could be an argument of the relation. The advantage of this representation is it is infinitely extendible to new relations that you may wish to log without changing the schema. Everything in the ActionTable should be a key or foreign key, I just haven't put that in there because it may be harder to read.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload