-
Notifications
You must be signed in to change notification settings - Fork 50
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
feat: Sec. indexes on relations #2670
Changes from all commits
ce1a479
63b3191
737504b
f62156c
d74fd65
3b23b96
e266107
181a1bd
5ef897b
dc87c67
830d66a
0b493aa
8b147bb
770ded3
76cfa77
fe8a7d4
4feb977
d145032
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Enable secondary index on relations | ||
|
||
This naturally caused some explain metrics to change and change detector complain about it. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -413,25 +413,23 @@ | |
childMapping = childMapping.CloneWithoutRender() | ||
mapping.SetChildAt(index, childMapping) | ||
|
||
if !childIsMapped { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was a nasty bug that took many hours to spot and fix. query {
Author {
name
s1: _sum(book: {field: rating, filter: {publisher: {yearOpened: {_eq: 2013}}}})
s2: _sum(book: {field: rating, filter: {publisher: {yearOpened: {_ge: 2020}}}})
}
} After the first aggregate is processed with correct That's why filter dependencies should be resolved for every aggregate. Let me know if you think there is a better solution. |
||
filterDependencies, err := resolveFilterDependencies( | ||
ctx, | ||
store, | ||
rootSelectType, | ||
childCollectionName, | ||
target.filter, | ||
mapping.ChildMappings[index], | ||
childFields, | ||
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
childFields = append(childFields, filterDependencies...) | ||
|
||
// If the child was not mapped, the filter will not have been converted yet | ||
// so we must do that now. | ||
convertedFilter = ToFilter(target.filter.Value(), mapping.ChildMappings[index]) | ||
filterDependencies, err := resolveFilterDependencies( | ||
ctx, | ||
store, | ||
rootSelectType, | ||
childCollectionName, | ||
target.filter, | ||
mapping.ChildMappings[index], | ||
childFields, | ||
) | ||
if err != nil { | ||
return nil, err | ||
} | ||
childFields = append(childFields, filterDependencies...) | ||
|
||
// If the child was not mapped, the filter will not have been converted yet | ||
// so we must do that now. | ||
convertedFilter = ToFilter(target.filter.Value(), mapping.ChildMappings[index]) | ||
|
||
dummyJoin := &Select{ | ||
Targetable: Targetable{ | ||
|
@@ -989,6 +987,7 @@ | |
return nil, err | ||
} | ||
|
||
childSelect.SkipResolve = true | ||
newFields = append(newFields, childSelect) | ||
} | ||
|
||
|
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.
praise: I like these!