When we use -s, main thread delegate some work to slave threads.
I'm running below code on the session with 3 slave thread: q -s 3
select from t where date within 2019.01.18 2019.01.20
Trying to understand how q used threads internally for above query.
Does kdb internally use each child thread to fetch data for a date and then main thread combine the data at the end?
something like:
main thread looking for slave threads and assigning work
slave 1: t1: select from t where date within 2019.01.18
slave 2: t2: select from t where date within 2019.01.19
slave 3: t3: select from t where date within 2019.01.20
main thread: t1,t2,t3
What work is done by each slave thread and what work is done by main thread?