-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add reverse lookup indices (#875)
- Loading branch information
Showing
4 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
internal/persistence/sql/migrations/sql/20220512151000000000_indices.down.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
DROP INDEX keto_relation_tuples_reverse_subject_ids_idx; | ||
DROP INDEX keto_relation_tuples_reverse_subject_sets_idx; |
1 change: 1 addition & 0 deletions
1
internal/persistence/sql/migrations/sql/20220512151000000000_indices.mysql.down.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP INDEX keto_relation_tuples_reverse_subject_idx ON keto_relation_tuples; |
8 changes: 8 additions & 0 deletions
8
internal/persistence/sql/migrations/sql/20220512151000000000_indices.mysql.up.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE INDEX keto_relation_tuples_reverse_subject_idx ON keto_relation_tuples (nid, | ||
subject_id, | ||
subject_set_namespace_id, | ||
subject_set_object, | ||
subject_set_relation, | ||
relation, | ||
namespace_id | ||
); |
13 changes: 13 additions & 0 deletions
13
internal/persistence/sql/migrations/sql/20220512151000000000_indices.up.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE INDEX keto_relation_tuples_reverse_subject_ids_idx ON keto_relation_tuples (nid, | ||
subject_id, | ||
relation, | ||
namespace_id | ||
) WHERE subject_set_namespace_id IS NULL AND subject_set_object IS NULL AND subject_set_relation IS NULL; | ||
|
||
CREATE INDEX keto_relation_tuples_reverse_subject_sets_idx ON keto_relation_tuples (nid, | ||
subject_set_namespace_id, | ||
subject_set_object, | ||
subject_set_relation, | ||
relation, | ||
namespace_id | ||
) WHERE subject_id IS NULL; |