KDB Find first date with data in each table of a process

68 Views Asked by At

I am trying to find first date where we have data available per process over IPC. I tried below but it isn't efficient. Is there a better way to find this?

select min date from ({select date from x where date=first date }each tables[])

I came across another way but that requires loading par.txt or hdb location which cannot be done over IPC.

(first date where@)each 0<.Q.pn

My ultimate goal is to open connection to HDB of each process from the list of processes, get the first available date where we have data for at least one table.

2

There are 2 best solutions below

0
Jack McDonough On BEST ANSWER

You can use .Q.pv to display a list of the partition values found in the hdb, then first to get the earliest date:

first .Q.pv

0
cillianreilly On

If your HDB is partitioned by date, a variable called date will exist in memory of the process. It will contain a list of dates in the HDB, you can pick up the first entry of this list via IPC:

`:host:port "first date"