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
5
votes
2 answers

Pass multiple arguments to a function within select

I'd like to calculate a new column which is a function of several columns using select. My actual application will involve a grouping in the select so the columns entries which I will pass to the function will contain lists. But this simple example…
ScarletPumpernickel
  • 678
  • 1
  • 7
  • 22
5
votes
2 answers

How does q cache data?

I was trying to measure data access times for a db I had created. It was taking ~1s for one day's data. To aggregate I ran the following code. I am using kdb studio and there are ~1MM trades in total every day \t ans: raze {select from trade where…
Naveen Sharma
  • 1,057
  • 12
  • 32
5
votes
3 answers

How to correctly partition a table in real-time in kdb?

I have a C application that streams data to a kdb memory table all day, eventually outgrowing the size of my server RAM. The goal ultimately is to store data on disk, so I decided to run a timer partition function to transfer data gradually. I came…
Robert Kubrick
  • 8,413
  • 13
  • 59
  • 91
5
votes
3 answers

How to delete random rows from a kdb table?

How can I delete the first 10 rows from a kdb table? I want to delete specifically the first 10 rows returned from: select [10] from mytable I tried to use delete with the i index but the count of rows does not decrease: count…
Robert Kubrick
  • 8,413
  • 13
  • 59
  • 91
5
votes
2 answers

How to generate a date range in kdb excluding weekend days?

This code produces a sequence of dates: firstdate: 2008.06.01 lastdate: 2008.08.31 daterange: firstdate + til (lastdate - firstdate) + 1 Is it possible to generate the same range excluding weekend dates (Sat/Sun)?
Robert Kubrick
  • 8,413
  • 13
  • 59
  • 91
5
votes
2 answers

Kdb+ : how to control permissions and entitlements

Can someone please advise how can we control permissions and entitlements in kdb+ to ensure the data/tables are properly access controlled? I understand there is -U user param for specifying the user/password, but the challenge is around table level…
4
votes
2 answers

Q (kdb+): Create a table with a character vector

I'm able to create a kdb+ table with atom types eg. trade:([]time:`time$();sym:`symbol$();price:`float$();size:`int$()) Is it possible to create an empty table with a character vector instead? Appreciate any help/examples I can get. My knowledge of…
qwerty
  • 3,801
  • 2
  • 28
  • 43
4
votes
2 answers

How to secure KDB/Q web interface

I am aware of the fact that we can run a Q process with the -p parameter which enables other instances to connect to it and enables also a web interface on that port. Is there a way how to secure the connection so there will be some kind of…
Jan Zyka
  • 17,460
  • 16
  • 70
  • 118
4
votes
4 answers

Can kdb read from a named pipe?

I hope I'm doing something wrong, but it seems like kdb can't read data from named pipes (at least on Solaris). It blocks until they're written to but then returns none of the data that was written. I can create a text file: $ echo Mary had a…
Martin McNulty
  • 2,601
  • 3
  • 22
  • 26
4
votes
2 answers

How to convert tic data to 5 minute OHLC?

I am learning KDB+ and have loaded the tic data into the table W as below. My question is, how to transfer the data into 5 (or n) minutes…
bigbug
  • 55,954
  • 42
  • 77
  • 96
4
votes
3 answers

How can one drop/delete columns from a KDB table in place?

Following the documentation, I tried to do the following: t:([]a:1 2 3;b:4 5 6;c:`d`e`f) // some input table `a`b _ t // works: delete NOT in place (enlist `a) _ t // works: delete NOT in place t _:`a`b …
S.V
  • 2,149
  • 2
  • 18
  • 41
4
votes
2 answers

KDB\Q: How to run an iterative union join from within a ticker function?

I am trying to run an iterative union join on a table from within a tick function according to the kdb tick architecture as follows: table1:([]time:`timespan$();sym:`symbol$();var1:`float$()); if[not system"t";system"t 1000"; .z.ts:{ …
James
  • 1,260
  • 13
  • 25
4
votes
2 answers

KDB+\q: How to fill regularly spaced time series?

I am trying to implement .ml.filltab[] located here on a table of timeseries data composed of regularly interspaced temporal aggregations i.e.: second | amount price -----------|---------------- 02:46:01 | 54 9953.5 02:46:04 | 150 …
James
  • 1,260
  • 13
  • 25
4
votes
1 answer

KDB Q and jupyterlab not using slaves on peach

I am running a jupyter notebook (3.6) and I have 20 slaves enabled on startup using "env":{"JUPYTERQ_SERVERARGS":"s-20"} If I check this in the notebook it looks all good \s 20i However when I run a parallel process, e.g., \t:100 {sqrt (200000?x)…
chrise
  • 4,039
  • 3
  • 39
  • 74
4
votes
1 answer

KDB+/q:What is a canonical implementation of a remote query?

I am trying to implement a multi line query from a python client using qpython. I would like to perform the following query: a = """ /declare a function that pivots a table on index piv:{[t;k;p;v]f:{[v;P]`${raze "_" sv x} each string raze…
James
  • 1,260
  • 13
  • 25