On this page
The SHOW STATEMENT HINTS statement lists the injected hints that have been created for a specific SQL statement fingerprint using the information_schema.crdb_rewrite_inline_hints() built-in function.
Required privileges
Users must have the VIEWCLUSTERMETADATA privilege to run SHOW STATEMENT HINTS.
Synopsis
Parameters
| Parameter | Description |
|---|---|
string_or_placeholder |
The SQL statement fingerprint to show injected hints for. This can be a string literal (such as 'SELECT * FROM users WHERE city = _') or a SQL parameter placeholder (such as $1) for use in prepared statements. |
Options
| Option | Value | Description |
|---|---|---|
DETAILS |
N/A | Include hint-specific information in JSON format. |
Response
The following fields are returned:
| Column | Type | Description |
|---|---|---|
row_id |
INT |
A unique ID. |
fingerprint |
STRING |
The SQL statement fingerprint that the hint applies to. |
hint_type |
STRING |
Hint type. rewrite_inline_hints indicates an injected hint. |
created_at |
TIMESTAMPTZ |
The timestamp when the injected hint was created. |
details |
JSONB |
When the DETAILS option is specified, hint-specific information in JSON format. For rewrite_inline_hints, this includes the donor SQL fingerprint with hints that will be applied. |
Examples
Show hints for a statement
To show all injected hints for a specific statement fingerprint:
SHOW STATEMENT HINTS FOR $$ SELECT * FROM users WHERE city = _ $$;
row_id | fingerprint | hint_type | created_at
----------------------+------------------------------------+----------------------+--------------------------------
1143470380756697089 | SELECT * FROM users WHERE city = _ | rewrite_inline_hints | 2026-01-21 21:11:06.782818+00
(1 row)
Show hints with detailed information
To include the donor fingerprint in the output:
SHOW STATEMENT HINTS FOR $$ SELECT * FROM users WHERE city = _ $$ WITH DETAILS;
row_id | fingerprint | hint_type | created_at | details
----------------------+------------------------------------+----------------------+-------------------------------+--------------------------------------------------------------------
1143470380756697089 | SELECT * FROM users WHERE city = _ | rewrite_inline_hints | 2026-01-21 21:11:06.782818+00 | {"donorSql": "SELECT * FROM users@users_city_idx WHERE city = _"}
(1 row)