Skip to content

Commit

Permalink
feat: add reverse lookup indices
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed May 12, 2022
1 parent 8c5eb9d commit 26efa56
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
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;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP INDEX keto_relation_tuples_reverse_subject_idx;
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,
);
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;

0 comments on commit 26efa56

Please sign in to comment.