Hi, I went through this article: <https://imply.io...
# general
p
Hi, I went through this article: https://imply.io/developer/articles/learn-how-to-achieve-sub-second-responses-with-apache-druid/ I wanted to know how are the data server processing threads spread across queries at a given instance. Suppose, I have 2 queries(Q1 and Q2) on my data node, and it only contains 2 segments. I have around 24 cores so my numProcessingThreads = 24. But, for Q1, only 2 threads out of these are working to fetch the segments. Now, for Q2, will it use some other 2 threads to read those 2 segments allowing concurrent reads, or is there a lock so that the same 2 threads will be shared across queries? Thanks !
b
Generally speaking, the historical service will use different threads to access the segment files in parallel. Segment files are immutable on the historical, so there is no lock placed on the files. There are however some additional optimizations when you factor in caching. If you use segment-level caching, if an aggregation has previously been performed the query will read the pre-aggregated data directly from memory rather than re-opening the segment files.
p
Thanks !