Help Center/ TaurusDB/ Kernel/ Common Kernel Functions/ Parallel Query/ Supported and Unsupported Scenarios
Updated on 2025-09-04 GMT+08:00

Supported and Unsupported Scenarios

Scenarios Supported by Parallel Query

Table 1 Scenarios supported by parallel query

Supported Scenario

Description

Scans

Full table scans, index scans, index range scans, index reverse scans, index point queries, and index pushdown

Queries

Single-table queries, multi-table joins, views, subqueries, and some CTE queries, non-partitioned table queries, single-partition queries of partitioned tables, and UNION/UNION ALL queries

Joins

BNL JOIN, BKA JOIN, HASH JOIN, NESTED LOOP JOIN, SEMI JOIN, ANTI JOIN, and OUTER JOIN

Subqueries

Conditional subqueries, scalar subqueries, some correlated subqueries, non-correlated subqueries, and derived tables

Data types

Integer, Character, Floating Point, and time

Expression calculation

Arithmetic expressions (+, -, *, %, /, |, and &) and conditional expressions (<, <=, >, >=, <>, BETWEEN/AND, and IN)

Logical operations

OR, AND, and NOT

General functions

Character, Integer, and Time functions

Aggregate functions

COUNT, SUM, AVG, MIN, and MAX

CAUTION:

If you want a SQL statement containing the COUNT aggregate function to use parallel query, instead of InnoDB parallel query, set innodb_parallel_select_count to OFF.

Sorting, grouping, pagination, and filtering

ORDER BY, GROUP BY/DISTINCT, LIMIT/OFFSET, WHERE/HAVING, and column projection

EXPLAIN statements

EXPLAIN FORMAT=TREE, EXPLAIN ANALYZE (supported in 2.0.60.241200 and later), and EXPLAIN FORMAT=JSON introduced in MySQL 8.0 and traditional EXPLAIN statements

Scenarios Unsupported by Parallel Query

Table 2 Scenarios unsupported by parallel query

Unsupported Scenario

Description

Statements

  • Non-query statements
  • PREPARE statements
  • System tables, temporary tables, and non-InnoDB tables
  • Subqueries that cannot be converted to semi-joins
  • Statements that do not meet the ONLY_FULL_GROUP_BY rules
  • HASH JOIN operations, during which data overflows to disks
  • Lock queries, such as SERIALIZABLE isolation level, FOR UPDATE or SHARE LOCK
  • Recursive queries
  • WITH ROLLUP
  • Statements with keyword HIGH_PRIORITY
  • No line of data returned in the execution result (The execution plan shows: Zero limit, Impossible WHERE, Impossible HAVING, No matching min/max row, Select tables optimized away, Impossible HAVING noticed after reading const tables, or no matching row in const table.)
  • Columns with type ZEROFILL. Its column values can be optimized to constants.
  • Stored procedures

Triggers

Triggers

Indexes

  • Spatial indexes
  • Full-text indexes
  • Index Merge

Functions

Window functions

Spatial functions (such as SP_WITHIN_FUNC)

User-defined functions

REF functions (VIEW_REF, OUTER_REF, and AGGREGATE_REF)

User-related functions (such as user, current_user, session_user, and system_user)

Spatial relationship functions (such as MBRContains, MBRCoveredBy, MBRCovers, MBRDisjoint, MBREquals, MBRIntersects, MBROverlaps, MBRTouches, and MBRWithin)

Functions starting with ST_

Spatial functions (GIS): GeomCollection, GeometryCollection, LineString, MultiLineString, MultiPoint, MultiPolygon, Polygon, ST_Distance, and Point

Encryption and hash functions: SHA, SHA1, SHA2, and MD5

Lock and synchronization functions: get_lock, is_free_lock, is_used_lock, release_lock, release_all_locks, and sleep

Other functions:

  • extractvalue
  • PS_CURRENT_THREAD_ID() and PS_THREAD_ID(CONNECTION_ID())
  • WAIT_FOR_EXECUTED_GTID_SET and WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS
  • UNCOMPRESS(COMPRESS())
  • STATEMENT_DIGEST_TEXT
  • BINARY and CONVERT
  • Generated columns, BLOB, TEXT, JSON, and GEOMETRY
  • GROUP_CONCAT
  • JSON_ARRAYAGG/JSON_OBJECTAGG
  • STD/STDDEV/STDDEV_POP
  • VARIANCE/VAR_POP/VAR_SAMP
  • BIT_AND, BIT_OR, and BIT_XOR
  • set_user_var
  • RAND functions with parameters
  • json_* (such as json_length and json_type)
  • st_distance
  • xml_str
  • weight_string
  • row_count

Incompatibility Between Parallel Queries and Serial Queries

  • Number of errors or alarms

    If an error or alarm message is displayed during serial queries, the error or alarm message will be displayed in each worker thread during the parallel queries. As a result, the total number of error or alarm messages increases.

  • Precision

    During parallel queries, if there is a function type in a SELECT statement, additional stored procedures will be generated in the intermediate results. As a result, compared with serial queries, the precision of the floating point part in parallel queries may be different, and the final results may be slightly different.

  • Truncation

    During the parallel queries, if there is a function type in a SELECT statement, additional stored procedures will be generated in the intermediate results. In this process, the calculation result of the function needs to be cached, and data truncation may occur (generally due to data type conversion, for example, covering a floating-point value to a character string). As a result, the final result is different from the serial queries.

  • Sequence of result sets

    Because tasks are executed by multiple worker threads during parallel queries, the sequence of the returned result set may not be consistent with that of serial queries. In the case of a query with LIMIT, this problem is more likely to occur. If fields of GROUP BY are invisible characters, the sequence of the returned result set is also different.

  • UNION ALL result sets

    UNION ALL ignores sort operators. The sequence of the returned result set in parallel execution may be different from that in non-parallel execution. In the case of a query with LIMIT, the result sets are different.