Soft Limits Explained
What is a Thread, a Plan, and a Queue
A plan in CData Virtuality refers to a query execution plan, which is a detailed structure that CData Virtuality generates to execute a query. It breaks the query down into logical steps, such as fetching data from sources, applying filters, joins, aggregations, etc. Thus, a plan is a high-level entity representing a query.
A thread in CData Virtuality is a unit of execution that performs tasks such as processing a part of a query or fetching data from sources, etc, and hence they are the backbone of query execution in CData Virtuality. Thus, threads are lower-level units of work that execute parts of the plan.
A job queue in CData Virtuality is an entity that holds the jobs for which CData Virtuality does not have enough free slots to run at the moment. For example, when a Queue Handler has a threadCount
(which is the number representing how many jobs can be run in parallel by the exact queue handler) of 15 parallel jobs and there already are 15 running jobs, jobs that you start next will get queued and remain there until one of the 15 already running jobs finishes and frees the slot. Queue handlers are the ones managing the running jobs and they pick "their" jobs (with schedules assigned to the specific queue handler) from the queue when there is an open slot. Thus, a job queue is a queue of jobs waiting for an available thread/slot to execute.
How Threads, Plans, and Queues Work Together
Queues handle the number and the order in which jobs are run. When a job is executed, plan(s) are created for it and then thread(s) are also created and assigned to the plans of the job.
Plans and Threads are related in the sense that if a query plan involves fetching data from three different sources, CData Virtuality might allocate multiple threads to handle these fetch operations concurrently. The settings max-active-plans
and max-threads
together help in balancing query concurrency and system performance. For instance:
max-active-plans
ensures that the system doesn’t get overwhelmed by too many active queries.max-threads
ensures that there are enough resources to efficiently execute the active plans.
How Requests Not Coming from a Job are Handled
When requests are not coming from a job (for example, from a Web UI or Studio query), CData Virtuality automatically creates and assigns the necessary plan(s) and thread(s) needed to execute the request without going through the Job Queue.