arcadedb
arcadedb copied to clipboard
SQL query issue with optimization
This following query doesn't work:
select from Chat let users = in('HasChat'), brain = out('CreatedFromAssistant') where #22:1 IN $brain AND ( contextVariables['local:fin'] = '7:106514432' OR @rid = '#7:106514432')
If I remove the OR condition inside the parhentesis works.
My first thought is to debug the execution and at a certain point the query is "flatten". Not sure why, maybe for index optimization? In the class SelectExecutionPlanner, method optimizeQuery() starts the computation of the flatten.
This fix slowed down many query execution, reopening it.
'#7:106514432'
Christ.