VTab BestIndex sets .omit when Used=true
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 9.2k
- Forks
- 1.2k
- Avg merge
- 19m
- Merged PRs (30d)
- 4
Description
https://github.com/mattn/go-sqlite3/blob/master/sqlite3_opt_vtable.go#L467
I'm willing to submit a PR, but wanted to first see if this was viewed as a misinterpretation of the documentation. I got the impression that setting .omit is only for specifying that you will take care of the constraint and you're hinting to sqlite that it can skip the step if it wants.
From: sqlite
it can try to suppress that double-check by setting aConstraintUsage[].omit
I guess I was hoping that one could set .Used = true in order to get hints and receive the right-side values in Filter(), but implement a best-effort filter and not a definite filter.
Would we be open to changing the behavior here to say that .Used = true just means you want to use the constraint and you can still receive it in filter, and we can add a separate .Omit = true to be more explicit about the omit? Or maybe to preserve backward compat with existing behavior we can add something like .UsedNoOmit = true.
Thoughts?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sqlite3_opt_vtable.go around line 467 and read SQLite’s xFilter documentation linked in the issue. Trace how Used is interpreted and decide whether the proposed omit behavior or a separate flag is compatible with existing callers. Done requires an agreed API behavior and an implementation that preserves compatibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100