cockroachdb / cockroachdb/cockroach

opt: apply external statement hints to routines inlined during normalization

Open
#172,764 1 comment 0 reactions 0 assignees View on GitHub
A-plan-management A-sql-optimizer A-sql-routine A-statement-hint C-enhancement docs-known-limitation O-agent T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Inline hint injection applies only to deferred routine body builds, which retry without hints on failure. Routines inlined during normalization (`ConvertUDFToSubquery`) are not hinted: an injection failure there surfaces via panic long after the rule ran, so a **fallback** requires replanning the enclosing statement, plus hint-dep staleness tracking for cached memos and a tighter `errorDueToInjectedHint` filter.

Part of #162627.

Epic: CRDB-66266

Contributor guide

Open the contributing guide

Research direction

Start by tracing ConvertUDFToSubquery and the normalization path where routines are inlined. Then examine the existing deferred routine hint injection, replanning behavior, cached memo dependencies, and errorDueToInjectedHint filter. Done means inline routines receive external statement hints safely, failures trigger the required enclosing-statement fallback, and hint-dependency staleness is handled.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.