Document the dolt_join_cost() function#74
Open
tbantle22 wants to merge 1 commit into
Open
Conversation
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>
This was referenced May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
DOLT_JOIN_COST()section under Informational Functions indolt-sql-functions.md, using the real memo output from dolt's engine test as the example plus an explanation of theGn/operator inputs cost/*notation. Added a matching TOC entry.sql-extensions.md).Verified:
astro buildis clean and the rendered page hasid="dolt_join_cost"with the TOC and index links resolving to it.On
dolt_storage_formatThe 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