Load Multiple HDBs in one KDB Process
With par.txt
and .Q.bv[]
you can load discrete HDB directories into a single KDB process.
For this to work, we assume that:
- Tables have unique names across the discrete databases.
- Symfiles are unique i.e. cannot have 2+ symfiles named
sym
for the different databases. - Symfiles are not stored at the root of discrete databases
Example setup:
# discrete hdb
internal
├── 2025.08.14
│ └── positions
│ └── orders
│ └── executions
├── 2025.08.15
│ └── positions
│ └── orders
│ └── executions
mktdata
├── 2025.08.15
│ └── minute_bars
│ └── daily_bars
symfiles
└── sym_internal
└── sym_mktdata
The unified hdb contains the par.txt
that lists all the discrete hdbs you want to load in one process. The database also includes symbolic links to the sym files.
# unified hdb
db
├── par.txt
├── sym_internal -> ../symfiles/sym_internal
└── sym_mktdata -> ../symfiles/sym_mktdata
# cat db/par.txt
/home/jp/kdb/internal
/home/jp/kdb/mktdata
To load the database and run .Q.bv[]
$ q db
q)tables[]
`minute_bars`daily_bars
q).Q.bv[] / will build vp
q)tables[]
`positions`orders`executions`minute_bars`daily_bars