kdb+ utility to search codebase

Kdb+ Utilities: Q code Workspace Utilities

6 Feb 2018 | , ,
Share on:

By Simon Garland

If you are a kdb+/q developer, you will find the workspace utilities created by Kx Managing Director and Senior Solution Architect Leslie Goldsmith to be a valuable resource. This is the first in a series of blog posts that give a quick introduction to several utilities available at Leslie Goldsmith’s GitHub. In this part of the series we look at an essential tool which contains routines for summarizing and searching the contents of a workspace, ws.


This elegant little toolkit by Leslie Goldsmith is an invaluable aid for programmers digging into large bodies of q code. It allows you to find where particular pieces of code come from. Instead of having to run through a lot of static script files you can comb through a live session to find, ‘where does this happen?,’ ‘where is this defined?,’ ‘where else has this been used’ and even ‘where does this typo come from?’

In the ‘70s and ‘80s when I worked at I.P. Sharp as an APL programmer, Leslie wrote an earlier version of these utilities for the APL programming language (library 7 WSSEARCH) which were something that every APL programmer used many times every day to search through large APL workspaces for the occurrences of particular pieces of code. In those days, the only alternative would have been to print the code out on stripy paper and go through it with a red pen.

Building on decades of  experience as a vector programmer, Leslie has recreated a finely-tuned version of this essential collection of tools for kdb+ programmers called ws. I highly recommend you take these utilities for a spin and have a look at the way they are written.

Leslie Goldsmith is currently a Managing Director and Senior Solution Architect at Kx, a division of First Derivatives (FD), based in Mississauga, Canada. Prior to this position, Leslie was co-founder and Managing Director at Affinity Systems, a software consulting and products firm acquired by FD in 2015. In Leslie’s long and storied career as a technologist, he has built many large, complex enterprise software systems and has set a standard of excellence in engineering for generations of developers. He is also the author of one of the world’s first commercial email systems, Mailbox, which debuted in 1973.

Simon Garland is Chief Customer Officer for Kx. He is responsible for upholding Kx’s high standards for technical excellence and customer responsiveness. Prior to joining Kx in 2002, Simon worked at a database search engine company, before that he worked at Credit Suisse in risk management. Simon began his career working with APL, and subsequently worked with the original k and kdb, as well as q and kdb+.

© 2018 Kx Systems
Kx® and kdb+ are registered trademarks of Kx Systems, Inc., a subsidiary of First Derivatives plc.


Kx Partner Companies Recognized for Excellence and Innovation

26 Jan 2018 | , , , , , , , ,

Over the last few months a number of startups using Kx technology have been recognized for excellence and innovation in their industries, including BrainWaveBank, 3DEO and RxDataScience (RxDS).
RxDS, is at the forefront of new types of interactive data science software applications for the pharmaceutical and healthcare industries. It uses Kx technology to power the Big Data analytics engine in its apps. Silicon Review noted RxDS’ rapid growth in revenue and customer acquisition in naming RxDS as one of the 30 Fastest Growing Private Companies to Watch.

socket sharding in kdb+

Socket Sharding with kdb+ and Linux

25 Jan 2018 | ,

In the latest Kx technical whitepaper, Marcus Clarke discusses the use of Socket Sharding, which was introduced as a new feature in kdb+ V3.5. Socket Sharding enables the use of Linux’s SO_REUSEPORT socket option, which allows multiple sockets to listen on the same IP address and port number combination. The kernel will then allocate connection requests across the listening processes.
In this paper, Marcus investigates several scenarios where processes are running with this socket option enabled. These include adding more listener processes on the fly, sending a large volume of requests, routing connections when one listener process is busy and rolling updates to minimize downtime.