KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

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 ] ?

  • darrenwsun

    Member
    May 24, 2022 at 12:00 am

    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)