#community-help

Performance Issues with Typesense Faceting and Nested Fields

TLDR Stefan experiences performance issues when faceting against 23 fields in Typesense, especially with nested fields. Kishore Nallan is working on a solution and will follow up on the thread.

Powered by Struct AI

3

Mar 14, 2023 (9 months ago)
Stefan
Photo of md5-d6c265b4792dbf0a1d6ae378f39d8736
Stefan
01:33 PM
Hi there,
I am having a bit of a performance problem, I have 50k+ docs in typesense and a query without faceting takes approx. 23ms, If I enable faceting it takes 100ms - 200ms. I am faceting against 23 fields which is probably too much, aside from reducing the number or lazy loading the facets what can I do to improve performance?

Also removing one nested field (array of objects) adds ~20 ms on it's own. The field has approx 20 items per doc. Is that expected?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:36 PM
Working on addressing this. Will have a solution in a couple of weeks I think :)
Stefan
Photo of md5-d6c265b4792dbf0a1d6ae378f39d8736
Stefan
01:38 PM
Faceting performance or nested faceting in particular?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:39 PM
Both are interlinked.
Stefan
Photo of md5-d6c265b4792dbf0a1d6ae378f39d8736
Stefan
01:39 PM
ah okay cool! Or not not sure haha.
But in this case I'll let the user wait for now 😄
01:45
Stefan
01:45 PM
Thanks!

1

Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:45 PM
👍 I will follow up on this thread when I have a RC build to share (as usual!) 🙂

1

Sergio
Photo of md5-19856b8e92142bdd0747d7a3706736c8
Sergio
01:51 PM
Is this a regression introduced in 0.24.0 or affecting older versions?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:52 PM
No, it's not a regression. It's an artifact of nested fields + the fact that it opens up an avenue to do a large number of faceting dynamically with nested attributes.

1

Sergio
Photo of md5-19856b8e92142bdd0747d7a3706736c8
Sergio
01:52 PM
Makes sense. Thanks