pingcap / pingcap/tidb

infra: allow internal process to see the original queries with literal values when redact-log is enabled

Open
#60,673 1 comment 0 reactions 2 assignees Claimed by @ghazalfamilyusa View on GitHub
sig/sql-infra type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
If we enable `redact-log`, then there is no way to see the original queries with literal values, which brings problems to some diagnosis features like `Index Advisor`.

```
mysql> select a from t where a=1;
Empty set (0.00 sec)

mysql> select QUERY_SAMPLE_TEXT from information_schema.STATEMENTS_SUMMARY;
+-----------------------------------+
| QUERY_SAMPLE_TEXT |
+-----------------------------------+
| select `a` from `t` where `a` = ? |
+-----------------------------------+
```

In the case above, after enabling `redact-log`, we can only see `a=?` instead of `a=1`.
For some diagnosis features, they need the original query with literal values to help analyze the workload.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.