Skip to content
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

Secondary Indexes: many side of one-many joins #2578

Closed
AndrewSisley opened this issue May 2, 2024 · 0 comments
Closed

Secondary Indexes: many side of one-many joins #2578

AndrewSisley opened this issue May 2, 2024 · 0 comments
Assignees
Labels
area/query Related to the query component feature New feature or request
Milestone

Comments

@AndrewSisley
Copy link
Contributor

AndrewSisley commented May 2, 2024

This does not currently work and is documented by a handful of tests, e.g. TestQueryWithIndexOnOneToMany_IfFilterOnIndexedRelation_ShouldFilterWithExplain

Consider achieving this with a rewrite of type_join.go: #2577

@AndrewSisley AndrewSisley added feature New feature or request area/query Related to the query component labels May 2, 2024
AndrewSisley added a commit that referenced this issue May 3, 2024
## Relevant issue(s)

Resolves #2574

## Description

Return correct results from one-many joins filtered on an indexed field
on the many side.

The invertibleTypeJoin doesn't support the inversion of one-many joins
and was converting them into one-one joins.

This means that the index is no longer used if targeting the many side:
#2578 (this support can
be added after the release).
@islamaliev islamaliev changed the title Secondary Indexes: Support many side of one-many joins Secondary Indexes: Enable indexing of related objects May 8, 2024
@islamaliev islamaliev changed the title Secondary Indexes: Enable indexing of related objects Secondary Indexes: many side of one-many joins May 8, 2024
islamaliev added a commit that referenced this issue Jun 4, 2024
## Relevant issue(s)

Resolves #2601 #2578 #2577

## Description

Enables fetching related objects via secondary indexes.

It also fixes a bug with queries that contain multiple aggregates on the
same collection.
@islamaliev islamaliev self-assigned this Jun 4, 2024
@islamaliev islamaliev added this to the DefraDB v0.12 milestone Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/query Related to the query component feature New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants