-
Notifications
You must be signed in to change notification settings - Fork 0
Index strings #10
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
Index strings #10
Conversation
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces functionality to index strings, likely for optimization, by adding a new strings table and related definitions. The changes are a good step towards improving performance.
My review has identified a few areas for improvement:
- The new
stringstable's primary key definition can be improved to ensure it's an auto-incrementing primary key, which is crucial for data integrity. - The
INSERTstatement for the new table needs to be adjusted accordingly. - A minor copy-paste error was found in a region comment.
- An unused constant with an unconventional name has been added.
I've provided specific suggestions to address these points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces string indexing functionality to optimize database storage by replacing repeated string values with indexed references. The implementation follows the approach described in the linked Transit blog post about reducing data size.
Key changes:
- Adds utility extension functions for unescaping SQL strings
- Creates a new
stringstable schema to store unique strings with auto-generated IDs - Defines column index arrays to identify which table columns should use string indexing
- Adds a feature flag to control the export of indexed strings
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/main/java/org/mtransit/commons/sql/SQLUtils.kt |
Adds extension functions for unquoting and unescaping SQL strings |
src/main/java/org/mtransit/commons/GTFSCommons.kt |
Defines string indexing schema, column mappings for route/direction/stop tables, and separator constant |
src/main/java/org/mtransit/commons/FeatureFlags.kt |
Adds feature flag to enable/disable string export functionality |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Links: