Unable to retrieve the complete execution SQL in slow queries, showing information such as TIM (leng:)

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 慢查询中获取不到完整的执行SQL,提示TIM(leng:)等信息

| username: Running

The image is not visible. Please provide the text you need translated.

| username: tidb菜鸟一只 | Original post link

Can you find all records in the database using the SQL template ID?

| username: Running | Original post link

No, is this field too short?

| username: 啦啦啦啦啦 | Original post link

The SQL is too long, right? Try increasing the tidb_query_log_max_len.

| username: tidb菜鸟一只 | Original post link

SHOW GLOBAL VARIABLES LIKE ‘%tidb_stmt_summary_max_sql_length%’;
Check how much this parameter is set to and increase it a bit. It seems that your SQL is a bit long and got truncated.

| username: Running | Original post link

It didn’t take effect.

| username: 裤衩儿飞上天 | Original post link

There is a range of values. Check the official documentation.

| username: 裤衩儿飞上天 | Original post link

It seems the maximum is 1G.

| username: tidb菜鸟一只 | Original post link

No, it’s this parameter of mine…

| username: Running | Original post link

Yes, it seems that after version 6.1, it can only be set through system variables. I just set it in the system configuration file, but it didn’t take effect.

| username: Running | Original post link

It has been confirmed that the parameter tidb_query_log_max_len can be used, but it can only be set through system variables.