2) Subjects number ~ 189000
3) Faces number (examples) ~ 243000
We use compreface's recognition API as a second factor for 2FA and see in pg logs sql queries like
select embedding0_.id as col_0_0_, embedding0_.embedding as col_1_0_, subject1_.subject_name as col_2_0_
from public.Embedding embedding0_ left outer join public.Subject subject1_ on embedding0_.subject_id=subject1_.id
where subject1_.api_key=$1
which takes much time to execute on our data (query explain analyse is below):
Describe the bug Our installation: 1) CompreFace 1.1.0 in k8s (3 api servers) with resourses:
2) Subjects number ~ 189000 3) Faces number (examples) ~ 243000
We use compreface's recognition API as a second factor for 2FA and see in pg logs sql queries like
which takes much time to execute on our data (query explain analyse is below):
I made a small research and found that this query is used for cache updating: 1) compreface api receives an update event through pg notify command 2) compreface api creates new EmbeddingCollection for cache and rewrite the cache entry by api key
Expected behavior
Compreface API uses more optimal approach to update
EmbeddingCollection
cache