Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 使用TIDB查询sql时候 sql的执行失败
SQL state [HY000]; error code [1105]; other error: [src/coprocessor/endpoint.rs:167]: WireError(OverRecursionLimit); nested exception is java.sql.SQLException: other error: [src/coprocessor/endpoint.rs:167]: WireError(OverRecursionLimit)
Could you provide the statement and the TiDB version?
Could you provide the statement and the TiDB version?
Could you provide the statement and the TiDB version?
The image is not visible. Please provide the text you need translated.
To be honest, this is probably the longest SQL statement I’ve ever seen. Can the application layer optimize it?
There might be some issues with the sentence; please optimize it.
Can it be modified from the configuration?
There is no problem with the SQL, it just seems to be too long, which causes the issue. However, this is the business scenario; I wonder if it can be modified from the TIDB configuration side.
In what business scenario would you need to write an SQL statement with a length of 120,000 characters?
One reason is that the table has too many fields, more than 1600. The business scenario is: using SQL to query the fields with null values in this table, which involves function calculations, and it adds up to a lot. Plus, there are some judgment conditions. Can this only be optimized at the SQL level? Can the size given by TiDB be modified?
Did you write such a long code just to retrieve non-empty records? Can’t you control it from the source to disallow empty values?
Because the data source is connected to the merchants, the source data cannot be modified.
This statement is to retrieve the count of records where all fields are not empty, right?
Try this variable and see if it works:
Is this something that needs to be handled and modified in the configuration file?
Session level:
SET cte_max_recursion_depth = 1000;
Global level:
SET GLOBAL cte_max_recursion_depth = 1000;
This SQL is too complex, and the database may not handle it efficiently or appropriately. It is recommended to optimize it from the application layer.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.