Hey!
There are calls of pydantic.main.validate_model in search queries.
It is very CPU-loaded operations. And especially it affects when there are huge models and queries returning many objects. It is not necessary to validate objects in search queries, just while creating and updating.
Can you please remove it or add some setting to avoid it?
For me qfix is:
redis_om.model.model.RedisModel.validate_primary_key = lambda x: Truepydantic.main.validate_model = lambda x, y: (y, set(y.keys()), False)
Hey! There are calls of
pydantic.main.validate_model
in search queries. It is very CPU-loaded operations. And especially it affects when there are huge models and queries returning many objects. It is not necessary to validate objects in search queries, just while creating and updating. Can you please remove it or add some setting to avoid it?For me qfix is:
redis_om.model.model.RedisModel.validate_primary_key = lambda x: True
pydantic.main.validate_model = lambda x, y: (y, set(y.keys()), False)