cockroachdb / cockroachdb/cockroach

sql: implement tail-call-optimization for EXISTS subqueries

Open
#135,638 0 comments 0 reactions 0 assignees View on GitHub
A-sql-plpgsql C-enhancement T-sql-queries
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Subqueries within a routine are themselves implemented as lazily-executed nested routines. With #135145, we implement tail-call optimization for nested routines and subqueries that are in tail-call position. This significantly improves performance for deep recursion, like what happens for PL/pgSQL loops. We should consider extending the TCO to apply to EXISTS subqueries as well.

Jira issue: CRDB-44659

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.