arcadedb icon indicating copy to clipboard operation
arcadedb copied to clipboard

SQL query issue with optimization

Open lvca opened this issue 2 months ago • 2 comments

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.

lvca avatar Sep 29 '25 19:09 lvca

This fix slowed down many query execution, reopening it.

lvca avatar Sep 30 '25 05:09 lvca

'#7:106514432'

Christ.

ExtReMLapin avatar Oct 03 '25 13:10 ExtReMLapin