-
-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Document indexes and make them opt-in #205
Conversation
Codecov Report
@@ Coverage Diff @@
## main #205 +/- ##
==========================================
+ Coverage 97.43% 97.49% +0.06%
==========================================
Files 177 181 +4
Lines 5895 6037 +142
==========================================
+ Hits 5744 5886 +142
Misses 151 151
Continue to review full report at Codecov.
|
🚀 Deployed on https://61cae8a090dfde07c76a4093--sqlmodel.netlify.app |
📝 Docs preview for commit dd453ba at: https://61cae8f3eaa6703b1dc08de3--sqlmodel.netlify.app |
✨ Document indexes and make them opt-in
Up to now, SQLModel created indexes for each column by default. This PR changes that to make indexes only opt-in (including the same line change as in #11), and documents indexes, etc.
This PR adds a new section explaining indexes, how they work, and how to enable them for columns.
It also updates all the rest of the docs examples to use indexes accordingly and references to indexes where necessary.
It adds tests for index creation (for the new tutorial source examples) and updates other tests as needed.
The rationale for the previous behavior of having indexes by default was that it's easy for beginners to not know about indexes, not spend the time to learn about them, and get bad reading performance. It was also partly inspired by how ElasticSearch indexes everything by default, but it probably makes more sense there that everything would be intended to be searchable. But I see this approach was not very generalizable as commented here #9 and #11. So I'm reverting that approach here and instead I'm documenting and explaining indexes as best as I could after several days of working on this.