I could not find an answer to this while going through the documentations. If I am running a query using the QUERY node of a couchbase, does couchbase automatically splits the query into multiple parts based on the cores available in the query node to parallely run each part of the SQL. For example if i have a query as below
SELECT * FROM bucket1;
And the query node has 8 cores, does the above query gets split into 8 PARTS?
Example query:
SELECT *
FROM bucket1
WHERE ...;
The above query first need to parse, prepare, plan. All these are run in serial. Plan generates various operators (Authorize, IndexScan, Fetch, Filter, Projection,....). During Execution each of those operators run independently and parallel work on different documents assuming there is no blocking operation (Like group, aggregation, sort). With in the Fetch it uses as much cores as possible to get the data. Check EXPLAIN there is parallel operators. By default it is 1, you can change that by setting query parameter max_parallelism (will change how many copies of those operators run in parallel) (each work different document). Setting higher value can impact negatively due to context switching.
The following two links has diagram which explains more details.
https://docs.couchbase.com/server/5.0/architecture/querying-data-with-n1ql.html https://dzone.com/articles/new-performance-tricks-with-n1ql
NOTE: CE version of query service only uses 4 cores.