Questions tagged [kdb]

kdb+ is a proprietary high-performance database developed by Kx Systems.

kdb+ is a proprietary high-performance database developed by KX.

Features

  • Scalable column-oriented database for massive data volumes
  • Manages real-time and historical data in one platform
  • A single system allowing for low latency communication between kdb+ processes
  • Coupled with the expressive q programming and query language

It comes with a programming language called q (or kdb/q). Both q and kdb are written in the k language which has the tag on this site.

More Information

KX have recently launched the KX Community, a site moderated daily by KX employees to ensure all questions are answered. For any questions, on q/kdb+ or any of the KX technology and products, our KX experts are on hand to help!

2014 questions
15
votes
3 answers

is kdb fast solely due to processing in memory

I've heard quite a couple times people talking about KDB deal with millions of rows in nearly no time. why is it that fast? is that solely because the data is all organized in memory? another thing is that is there alternatives for this? any big…
zinking
  • 5,561
  • 5
  • 49
  • 81
14
votes
3 answers

KDB+ like asof join for timeseries data in pandas?

kdb+ has an aj function that is usually used to join tables along time columns. Here is an example where I have trade and quote tables and I get the prevailing quote for every trade. q)5# t time sym price size…
signalseeker
  • 4,100
  • 7
  • 30
  • 36
11
votes
3 answers

Q (kdb): nested where query

What are the ways to in Q to use the results of a nested query in a where clause? I'm looking for something similar to SQL statement. select from food where type_id in ( select type_id from types where type_name = "fruit" )
Leonid
  • 22,360
  • 25
  • 67
  • 91
10
votes
4 answers

KDB/Q memory consumption

I have a KDB/Q databse which has around ~2M records per day consuming about ~2G of memory. At end of day it runs some reporting stuff doing joins between the tables and outputting result into files on disk. During the computation the memory usage…
Jan Zyka
  • 17,460
  • 16
  • 70
  • 118
9
votes
3 answers

Exists function in q/kdb

I need to write a function in q/kdb which takes a variable v and returns 1b if v is defined and 0b if it is not: $ a:2 $ doesExist`a 1b $ doesExist`b 0b Any ideas appreciated.
Viriya
  • 167
  • 3
  • 7
8
votes
1 answer

Behavior of Insert and Upsert in KDB

I have following table: q) t:([s:`symbol$()] id:();id2:`int$()) where 's' is a primary key and 'id' col has general type. I am trying to understand following behavior when inserting a list (string in this ex.) in 'id' column: a) Upsert…
Rahul
  • 3,914
  • 1
  • 14
  • 25
8
votes
2 answers

Can I set column attributes for a kdb partitioned table?

Is it possible to set column attributes for a partitioned table? q)h "update `g#ticker from `pmd" 'par q)h "update `s#ts from `pmd" 'par q) Should I set the attributes on the memory table, before I run the partitioning? Will the attributes be…
Robert Kubrick
  • 8,413
  • 13
  • 59
  • 91
8
votes
7 answers

KDB/Q: how to loop without loops?

I am learning q on kdb database. I am concerned by the fact that there are no loops in q. I need to write an algorithm that I would write with several nested for-loops in a verbose program like C. But in q I am stuck by the fact that I cannot…
Marco Mene
  • 397
  • 2
  • 6
  • 11
7
votes
3 answers

Python and kdb integration

What are available tools/libraries to integrate Python with kdb?
Leonid
  • 22,360
  • 25
  • 67
  • 91
7
votes
1 answer

KDB+ / Q Accessing root namespace from namespace

how can I access functions/variables in the root namespace once I jumped into another namespace. Example like this: q)\d .cfg q)domIV:1000 q)\d . q)n:1000 And then later on I know how to access the variable domIV from the other namespace, but I…
Martin Mlostek
  • 2,755
  • 1
  • 28
  • 57
7
votes
5 answers

KDB; stripping characters from column of symbols

Any ideas how to do this nicely in KDB? Consider the table X:([]a:1 2 3;b:`abc11`abc22`abc33;c:10 20 30) I now want a new table Y that has the "abc" stripped out of the symbols in the second column, such that: Y:([]a:1 2 3;b:`11`22`33;c:10 20 30)
bigO6377
  • 1,256
  • 3
  • 14
  • 28
7
votes
0 answers

Limitations of running kdb+ 32-bit version

Now that the 32-bit version of kdb+ has been made free for commercial use by kx, what benefits are there still to buying a licence, other than: 64-bit version will allow you to address more than 4GB of memory You will get support and access to a…
mollmerx
  • 648
  • 1
  • 5
  • 18
7
votes
2 answers

Merging sym files for splayed tables

I have two directories that each contain a date-partitioned splayed table. Each directory has its own sym file as expected. The tables are exactly the same. I want to consolidate this into one directory but am having issues doing so. Initially I…
Geoffrey Absalom
  • 1,815
  • 15
  • 16
6
votes
1 answer

KDB+/q: How to implement an aggregation table for features?

I am trying to implement an aggregation table that collates data from multiple disparate tables into one for feature engineering, preprocessing and normalization. I am facing numerous problems the first of which is that I have to somehow construct…
James
  • 1,260
  • 13
  • 25
6
votes
2 answers

How to select a subset of columns from table with list in kdb+/q?

Given the following table: time | col1 col2 col3 ... -------------------------------- 10:53:02 | 89 89 76 ... ... How does one select a subset of columns from this table (including the index) referenced by a list of column names…
1
2 3
99 100