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

SetPayloadOperation is slower than upserting the entire point #616

Open
sebastiancojocariu97 opened this issue Apr 30, 2024 · 2 comments
Open

Comments

@sebastiancojocariu97
Copy link

sebastiancojocariu97 commented Apr 30, 2024

Hello!

I am currently utilizing the SetPayloadOperation method to update specific parts of the payload for existing points. Each SetPayloadOperation will have a single point ID. Even when using custom sharding and multiple workers, the performance of this operation is not as good as the upsert method. Theoretically, upsert should be slower since it requires pushing the full payload and vector. However, in practice, upsert is at least 5 times faster than SetPayloadOperation. I am wondering if this behavior is normal. Thank you!

@joein
Copy link
Member

joein commented May 21, 2024

Hi @sebastiancojocariu97 , could you provide an example of your request?
How do you specify points?
What is the wait parameter value?
Do you use grpc or rest?

@sebastiancojocariu97
Copy link
Author

sebastiancojocariu97 commented Jun 14, 2024

Hello!
I am using grpc and I am packaging the requests (which are sent in parallel for each shard_id using multiprocessing) as follows:

update_operations = []
for obj, target_fields in batch:
        update_op = qdrant_models.SetPayloadOperation(
            set_payload=qdrant_models.SetPayload(
                payload=obj.model_dump(by_alias=True, include=target_fields),
                points=[obj.hash],
                shard_key=shard_id,
            )
        )
        update_operations.append(update_op)

await client.batch_update_points(collection_name=collection_name, update_operations=update_operations, wait=False)

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

No branches or pull requests

2 participants