Home › Forums › kdb+ › What is the role played by key columns in a keyed table [ query join/performance ] ? › Re: What is the role played by key columns in a keyed table [ query join/performance ] ?
-
Regarding why q-sql doesn’t do key lookup internally if the search is on the key, short answer is that they are not equivalent. Consider a keyed table where there are duplicate keys (yes this is allowed in KDB, there is no such thing as “primary key constraint” in this world), q-sql may return a table of multiple rows, while the key lookup form returns a dictionary representing the first entry (you know why – the search stops at first matched entry)