tencent cloud

TDSQL Boundless

SELECT Statement Description

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-07-08 17:25:18
This document introduces the SELECT query statements supported for use in TDSQL Boundless read-only analysis instances, along with related explanations.

Object Permission Description

In a read-only analysis instance, data queries can only be performed on data objects that have been fully loaded into the columnar read-only analysis engine. To query data, you must have SELECT privileges on the corresponding tables. If you lack the required privileges, grant object permissions through TDSQL Boundless account management. For the operation, see Modify Account Permissions.

SELECT Statement

The read-only analysis instance supports data queries using SELECT statements. The syntax skeleton is as follows.
[WITH [RECURSIVE] cte_name [(col_name [, col_name] ...)] AS (subquery)
[, cte_name [(col_name [, col_name] ...)] AS (subquery)] ...]
SELECT
[ALL | DISTINCT | DISTINCTROW]
select_expr [, select_expr] ...
[FROM table_references
[WHERE where_condition]
[GROUP BY {col_name | expr | position} [, ...]
[WITH ROLLUP]]
[HAVING where_condition]
[WINDOW window_name AS (window_spec)
[, window_name AS (window_spec)] ...]
[ORDER BY {col_name | expr | position} [ASC | DESC] [, ...]]
[LIMIT {[offset,] row_count | row_count OFFSET offset}]]
The SELECT syntax features supported by the read-only analysis instance are as follows:
It supports WITH Common Table Expressions (CTEs), including recursive CTEs with WITH RECURSIVE.
It supports set operations, including UNION, UNION ALL, INTERSECT, INTERSECT ALL, EXCEPT, and EXCEPT ALL.
It supports table joins, including INNER JOIN, LEFT JOIN, RIGHT JOIN, CROSS JOIN, and STRAIGHT_JOIN.
It supports window functions (the OVER clause).
It supports scalar subqueries, IN subqueries, EXISTS subqueries, and correlated subqueries.
It supports multi-dimensional aggregation with GROUP BY ... WITH ROLLUP.

Clauses Not Effective or Not Supported in SELECT Statements

The following section describes the statement units within the complete MySQL SELECT syntax that are ineffective or unsupported in the read-only analysis instance.

Clauses Not Effective but Not Affecting Execution

The following keywords or options are ineffective in the read-only analysis instance, but retaining them does not affect the execution result of the SQL statement.
HIGH_PRIORITY: This keyword is used to set the execution priority for SELECT statements. The read-only analysis instance schedules queries based on its own columnar execution optimizer, rendering this keyword ineffective.
STRAIGHT_JOIN (when used as a SELECT option): This keyword is used to force the optimizer to join tables in the order listed in the clause. The read-only analysis instance selects execution plans entirely based on its own columnar execution optimizer, rendering this keyword ineffective.
SQL_SMALL_RESULT, SQL_BIG_RESULT, SQL_BUFFER_RESULT, SQL_NO_CACHE, and SQL_CALC_FOUND_ROWS: These query options are all ineffective in the read-only analysis instance.

Clauses Not Supported and Causing Statement Execution Failure

The following clauses are not supported in the read-only analysis instance. Using them will cause the SQL statement execution to fail.
PARTITION (partition_list) clause: The read-only analysis instance currently does not support the query path for partition tables. Queries using this clause will fail to execute.
FOR UPDATE clause: The read-only analysis instance is designed for read-only analysis scenarios and does not support row-level exclusive locks. Queries using this clause will fail to execute.
LOCK IN SHARE MODE clause: The read-only analysis instance does not support row-level shared locks by default. Queries using this clause will fail to execute.
INTO DUMPFILE clause: An error is reported during the syntax parsing phase.
INTO @variable clause: An error is reported during the syntax parsing phase.
Note:
The LOCK IN SHARE MODE clause can be enabled as a no-op (no operation) compatibility mode by setting the system variable libra_enable_noop_functions to ON. Once enabled, this clause is syntactically accepted but does not produce an actual locking effect.
The INTO OUTFILE clause can be parsed syntactically, but its execution requires the corresponding FILE privilege and environment configuration. It is recommended to avoid using it in the read-only analysis instance.

Ajuda e Suporte

Esta página foi útil?

comentários