Hi,
Just a couple of questions about keyed tables, which I am sure will be trivial to someone who is already familiar with KDB.
I couldn’t find the answers I was looking for in the documentation, or Q For Mortals.
I also consulted Q Tips and Machine Learning and Big Data with kdb+/q, and I found conflicting information about what a keyed-table actually is.
My primary question is “what is a keyed table?”. I want to understand in detail what it is and how it works.
I have seen I think at least three different descriptions, which all conflict and cannot all be simultaneously true.
This is what I have read:
- A keyed table is a dictionary with a single key and a single value. The key is a table. The value is a table. In effect, this is the same as a pair of tables.
- A keyed table is a dictionary with many keys and many values. Each key is a table row, each value is a table row. This is weird, because KDB is a columnar data storage engine. So it cannot be implemented like this, because this is a description of row-major data and not column-major data.
- A keyed table is a dictionary just as a regular table is a dictionary, however some columns are marked as being part of the key. This is a bit like a table with attributes, with a new attribute meaning “this column is part of the key” (and in which order).
I am sure that none of these is completely accurate.
It is also worth mentioning that in explaining what a keyed table is, there are at least 3 ways to explain it.
- The data layout in memory and implementation of a keyed table
- An explanation about what a keyed table is “logically”
- An explanation about what a keyed table is “semantically”
Is anyone able to clarify exactly what a keyed table is?