7 Replies Latest reply on Jun 5, 2017 4:30 PM by shawkins

    Optimizer and over constraining

    damien_b

      We deal with a particular OData almost v2 server that uses system functions disguised as entities. Basically, "/A('b')/C" works but not "/C?$filter=foo eq 'b'". In order to have that, we've enabled the joins support on the ODataTranslator, but we still haven't the right query generated. We've traced back the origin to the optimizer:

      • SELECT * FROM a join b ON a.x=b.y WHERE a.x='v'
      • is optimized as SELECT <columns> FROM a join b ON a.x=b.y WHERE a.x='v' AND b.y='v'

      The extra induced condition "b.y = 'v'" messes up with the URL construction. Is there a way to hint the optimizer to not add the extra constraint?