Skip to content

Starting kdb+

This is a quick-start guide to kdb+, aimed primarily at those learning independently. It covers system installation, the kdb+ environment, IPC, tables and typical databases, and where to find more material. After completing this you should be able to follow the Borror textbook Q for Mortals, and the Reference.

One caution: you can learn kdb+ reasonably well by independent study, but for serious deployment of the product you need the help of a consultant. This is because kdb+ is typically used for very demanding applications that require experience to set up properly. Contact KX for help with such evaluations.

Kdb+

The kdb+ system is both a database and a programming language.

  • kdb+: the database (k database plus)
  • q: a general-purpose programming language integrated with kdb+

Resources

code.kx.com

The best resource for learning q. It includes:

GitHub

Discussion groups

Install free system

If you do not already have access to a licensed copy, go to Get started to download and install q.

Example files

Two sets of scripts are referenced in this guide:

  1. The free system is distributed with the following example scripts in the main directory:

    • sp.q – the Suppliers and Parts sample database
    • trade.q – a stock trades sample database

    If you do not have these scripts, get them from KxSystems/kdb and save them in your QHOME directory.

  2. Other example files are in the KxSystems/cookbook/start directory.

    Move the start directory under your QHOME directory, e.g. q/start. For example, there should be a file:

    ~/q/start/buildhdb.q
    c:\q\start\buildhdb.q

Text editor for Windows

Since q source is in plain text files, it is worth installing a good text editor such as Notepad++ or Notepad2.

Some text editors have extensions to provide e.g. syntax highlighting for q. See the list of editor integrations

Graphical user interface

When q is run, it displays a console where you can enter commands and see the results. This is all you need to follow the tutorial, and if you just want to learn a little about q, then it is easiest to work in the console.

As you become more familiar with q, you may prefer to work in the interactive development environment KX Developer. (Kx Analyst is the enterprise version of Developer.)