Is there a parameter that controls the incomplete display of SQL statements in the TiDB slow log?

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

Original topic: tidb slow log 里面的sql 语句显示不全,是不是有什么参数控制这种行为?

| username: Raymond

Excuse me, teachers, the SQL statements in the TiDB slow log are not fully displayed. Is there any parameter that controls this behavior? Does the tidb_stmt_summary_max_sql_length parameter control this behavior?

| username: ngvf | Original post link

Try modifying the length of this and test it.

| username: xuexiaogang | Original post link

I guess what he means is that it’s still not fully visible. I’ve seen people write SQL with a million lines, so it can never be fully visible.

| username: xuexiaogang | Original post link

Sometimes it’s incomplete because the SQL is too long, and generally speaking, overly long SQL is not good. Displaying it is one issue, but it’s better to address it fundamentally. You can view the complete SQL in the slow log and correct it.

| username: Raymond | Original post link

Sometimes it’s incomplete because the SQL is too long, and generally speaking, overly long SQL is not good. Displaying it is one issue, but it’s better to address the root cause. You can view the complete SQL in the slow log and correct it.

It’s just that the complete SQL can’t be viewed in the slow log.

| username: ngvf | Original post link

What is the purpose of 1 million lines? I’m very curious.

| username: Meditator | Original post link

100,000 lines? The entire Redis source code is only tens of thousands of lines!!!

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

:joy: I’ve seen SQL with hundreds of thousands of IN values, probably something similar.

| username: Meditator | Original post link

Don’t spoil the developers, take them out and sacrifice them to the heavens.

| username: Raymond | Original post link

The parameter tidb_stmt_summary_max_sql_length controls the display length of SQL queries, and it has been proven.

| username: HACK | Original post link

It shouldn’t be IN, right? :sweat_smile:

| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.