Skip to main content
The SHOW STATEMENT HINTS lists the that have been created for a specific SQL statement fingerprint using the information_schema.crdb_rewrite_inline_hints() and information_schema.crdb_set_session_variable_hint() .

Required privileges

Users must have the privilege to run SHOW STATEMENT HINTS.

Synopsis

show_statement_hints syntax diagram

Parameters

ParameterDescription
string_or_placeholderThe SQL statement fingerprint to show 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

OptionValueDescription
DETAILSN/AInclude hint-specific information in JSON format.

Response

The following fields are returned:
ColumnTypeDescription
row_idINTA unique ID.
fingerprintSTRINGThe SQL statement fingerprint that the hint applies to.
hint_typeSTRINGHint type. REWRITE INLINE HINTS indicates a rewritten inline hint. SET VARIABLE indicates a session variable override.
databaseSTRINGThe database the hint applies to. NULL if the hint applies to all databases.
enabledBOOLWhether the hint is enabled.
created_atTIMESTAMPTZThe timestamp when the hint was created.
detailsJSONBWhen 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. For SET VARIABLE, this includes the session variable name and value.

Examples

Show hints for a statement

To show all hints for a specific statement fingerprint:

Show hints with detailed information

To include hint-specific details in the output:
This example shows a REWRITE INLINE HINTS type hint. For a SET VARIABLE hint, the details would include the session variable name and value:

See also