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

Favor upsert over add + use element_id to prevent duplicates #2926

Closed
wants to merge 8 commits into from

Conversation

0xjgv
Copy link

@0xjgv 0xjgv commented Apr 24, 2024

Make chroma ingest pipeline idempotent :)
@potter-potter

@potter-potter
Copy link
Contributor

@0xjgv Thanks for this! And thanks for alerting me. Great idea.

I will bring it up to the team.

@ahmetmeleq
Copy link
Contributor

Thanks for the PR! I do agree with the upsert.

I had doubts on assigning the element id, however based on the last state of id calculation, collisions don't seem to be likely. Looks good to me, needs to pass ingest tests.

@potter-potter
Copy link
Contributor

@ahmetmeleq @0xjgv can you see any downsides to doing it this way? (seems like it is a good idea all aound)

@potter-potter
Copy link
Contributor

@ryannikolaidis Think this change will affect any users of ChromaDB that expect duplicates? (not sure why they would want duplicates....)

@ryannikolaidis
Copy link
Contributor

@ryannikolaidis Think this change will affect any users of ChromaDB that expect duplicates? (not sure why they would want duplicates....)

with matching ids? I think that's okay

@0xjgv
Copy link
Author

0xjgv commented May 23, 2024

@ahmetmeleq @0xjgv can you see any downsides to doing it this way? (seems like it is a good idea all around)

🤔 I can't think of any downsides though. Collisions are not very likely and there are no clear advantages to allowing duplicates in the DB. Idepomtecy reduces storage space, increases query performance, and simplifies data maintenance and integrity.

@potter-potter
Copy link
Contributor

@0xjgv Thanks for this! I am putting it into a small pr with one other small update so that it runs through our CI/CD.

#3086

@0xjgv
Copy link
Author

0xjgv commented May 24, 2024

Implemented in #3086

@0xjgv 0xjgv closed this May 24, 2024
@0xjgv 0xjgv deleted the patch-1 branch May 24, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants