-
Notifications
You must be signed in to change notification settings - Fork 4k
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamSQL Queries Teambranch-release-25.4Used to mark GA and release blockers and technical advisories for 25.4Used to mark GA and release blockers and technical advisories for 25.4
Description
Inline hints are a simple way to directly influence the optimizer. But the fact that hints must be added to the statement text makes them difficult to use, especially when it's not possible to modify the application sending the statement.
This issue is about building a way to inject hints without changing the statements being hinted. A rough idea of the capability is something like:
SELECT crdb_internal.inject_hints(
'SELECT name, age FROM cat WHERE breed = _ ORDER BY age DESC LIMIT _',
'SELECT name, age FROM cat@cat_age_idx WHERE breed = _ ORDER BY age DESC LIMIT _'
);Which will force the following query to use index cat_age_idx:
SELECT name, age
FROM cat
WHERE breed = 'shorthair'
ORDER BY age DESC
LIMIT 1;Jira issue: CRDB-54520
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-queriesSQL Queries TeamSQL Queries Teambranch-release-25.4Used to mark GA and release blockers and technical advisories for 25.4Used to mark GA and release blockers and technical advisories for 25.4
Type
Projects
Status
26.1 Release