Skip to content

Document the dolt_join_cost() function#74

Open
tbantle22 wants to merge 1 commit into
devfrom
document-dolt-join-cost
Open

Document the dolt_join_cost() function#74
tbantle22 wants to merge 1 commit into
devfrom
document-dolt-join-cost

Conversation

@tbantle22
Copy link
Copy Markdown
Collaborator

Closes #66.

Documents dolt_join_cost(), a planner-diagnostic scalar function (join_cost.go). It takes a SQL query string, analyzes it (doesn't execute), and returns the join memo — the relation groups the planner explored, the candidate physical join operators considered for each (hash / merge / lookup / inner) and their estimated costs, with the chosen plan marked *. It's useful for tuning a slow join or confirming a join hint took effect.

Changes:

  • New DOLT_JOIN_COST() section under Informational Functions in dolt-sql-functions.md, using the real memo output from dolt's engine test as the example plus an explanation of the Gn / operator inputs cost / * notation. Added a matching TOC entry.
  • Added it to the SQL extensions index (sql-extensions.md).

Verified: astro build is clean and the rendered page has id="dolt_join_cost" with the TOC and index links resolving to it.

On dolt_storage_format

The issue also listed dolt_storage_format. Intentionally leaving that one undocumented — per your call it's not relevant enough anymore to surface. Closing the issue on that basis; happy to reopen/split if you'd rather track it separately.

🤖 Generated with Claude Code

Closes #66.

dolt_join_cost(<query>) is a planner-diagnostic scalar function (see
JoinCostFuncName in go/libraries/doltcore/sqle/dfunctions/join_cost.go):
it analyzes the given query and returns the join memo — the explored
relation groups, the candidate physical join operators (hash/merge/
lookup/inner) and their estimated costs, with the chosen plan marked
`*`. Useful for tuning joins and confirming a join hint took effect.

- New `DOLT_JOIN_COST()` section under Informational Functions in
  dolt-sql-functions.md (with the real memo output from the engine
  test as the example and an explanation of the notation), plus a TOC
  entry.
- Added it to the SQL extensions index.

Intentionally NOT documenting the other function from the issue,
`dolt_storage_format` — per maintainer call it's no longer relevant
enough to surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document undocumented dolt SQL functions

1 participant