0
FOR e IN events 
 FOR b IN broadcasts  
 FILTER e.eventId == b.eventId 
 LET ev = e
 LET bcasts = b 

 COLLECT evt = ev INTO broadcasts KEEP bcasts

 SORT broadcasts[*].bcasts.live DESC, broadcasts[*].bcasts.listenerCount DESC, LENGTH(broadcasts[*].bcasts) DESC LIMIT 0, 10 //ofset 0 limit 10
 return {
  event : {
    name : evt.name,
    eventId : evt.eventId,
    casterCount : LENGTH(broadcasts[*].bcasts),
    broadcasts : (FOR bc IN broadcasts[*].bcasts RETURN {bid:bc.broadcastId,created:bc.created,live:bc.live,listenerCount:bc.listenerCount})
  }
}

I'm new to ArrangoDB(3.6) and have an index question. ON that query above, it's not using the persistent indexes I created on events & broadcasts collections. "FILTER e.eventId == b.eventId "

Explain shows no indexes are used. Am I missing something?

Thank you

  • Can you add the explain output and your Index definitions? – mpoeter Apr 07 '20 at 07:32
  • Using "explain" to show the plan and index stats is very important, and usually gives you clues as to why an index is or is not being used. Could you show that output, and possibly your indexes as well? I have seen times when the engine decides not to use a perfectly good hash/persistent index just because it's "sparse". – kerry Apr 23 '20 at 18:11

0 Answers0