-
Notifications
You must be signed in to change notification settings - Fork 4
ensure_node|edge_attr_index for SQLGraph
#223
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #223 +/- ##
==========================================
- Coverage 88.45% 88.43% -0.02%
==========================================
Files 55 55
Lines 3890 3910 +20
Branches 674 678 +4
==========================================
+ Hits 3441 3458 +17
- Misses 267 268 +1
- Partials 182 184 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Maybe we need drop functions |
JoOkuma
left a comment
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.
@yfukai, awesome PR, I had hadn't thought of adding this.
| SQLGraph lets you create indexes on node or edge attributes to keep repeated | ||
| filters fast: |
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.
@yfukai this is awesome. Could you briefly mention what kind of speed-up we can expect with this? 2x, 10x?
| unique: bool = False, | ||
| name: str | None = None, | ||
| ) -> str: | ||
| """Ensure an index exists for the given node attribute columns. |
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.
@yfukai, is this true?
I added this comment because I was trying to understand why it is ensure.
Also, could you highlight in the docs what the benefit of the name parameter is?
I have the impression that there's also a reason why you're returning the name.
I think it would enhance the user experience when using these methods.
This could be duplicated in the ensure_edge_attr_index docs.
| """Ensure an index exists for the given node attribute columns. | |
| """ | |
| Ensure an index exists for the given node attribute columns. | |
| If they are already indexed, they are kept as they are. |
This pull request introduces a new feature for the
SQLGraphbackend: the ability to create explicit database indexes on node and edge attributes to improve query performance, especially for frequently filtered attributes. The documentation and tests have been updated to reflect and validate this functionality.SQLGraph indexing improvements:
ensure_node_attr_indexandensure_edge_attr_indextoSQLGraphfor creating indexes on node and edge attribute columns, including support for composite and unique indexes. (src/tracksdata/graph/_sql_graph.py)docs/concepts.md)README.md)Testing and validation:
src/tracksdata/graph/_test/test_graph_backends.py)sqlalchemyimport to support index inspection in tests. (src/tracksdata/graph/_test/test_graph_backends.py)