Why does inner join on _type take significantly longer than joins on arrays or strings in Sanity.io GROQ?

26 views Asked by At

I am experiencing slow performance in my GROQ query when performing an inner join on _type. This join takes much longer than the other two joins, such as those on arrays or strings. Upwards of tenfold higher response time.

What am I missing here? I was convinced the join on _type would be the best optimized one of the three!??!

*[ _type == "careFeedItem" 
  && reference->_type == "task" // ⌛
  && $territory in reference->territories[]._ref
  && module->slug.current in $modules
]
0

There are 0 answers