Why doesn’t my query ‘select from reallybigtable’ ever return?

It’s a valid query, but q will run out of memory before returning. You’ll have to add some constraints to the query to reduce the size of the result set. Something like

select from reallybigtable where date = YYYY.MM.DD

would be a good start.

How portable is q code across operating systems?

kdb is available on Windows, Linux, Solaris and Mac OS X. Like most functional languages, q is a very high level language. As long as you stick with forward slashes in your file paths, you will be rarely notice the difference between operating systems. The only significant issue we’ve come across is that multi-threading is not supported on Macs.

If you do need to distinguish different operating systems, use the variable .z.o to detect the operating system in which your code is running.

What should I know about the sym file, and why back it up?

In a partitioned database, the sym file is a string intern pool which grows every time a new distinct symbol is introduced and persisted to that database. The sym file cannot be regenerated (unless you know the exact order in which your data was loaded from the inception of your database) and does not automatically shrink when symbols are removed from the database.

See this solution to compacting a bloated sym file.


This work is licensed under a Creative Commons License.
The views and opinions expressed herein are those of the authors and do not necessarily reflect those of any other person or legal entity.
Kdb+ is the registered trademark of Kx Systems, Inc.