3 Replies Latest reply on Dec 2, 2018 10:54 AM by user7675387

    Optimizer not using index when query param starts with double backslash

    user7675387

      Hi,

       

      we are using Oracle 11g and have some problems with a simple query.

       

      The is a table T with the fields AID (NUMBER(24,8)) and AF (VARCHAR2(240 BYTE)).

      Both fields are indexed.

       

      When doing a SELECT like

       

      SELECT * FROM T WHERE AID=382 AND AF = '\\domain\test\1123.pdf';

       

      The indexes are not used and the query tooks 3 seconds..

       

       

      When doing a SELECT like

       

      SELECT * FROM T WHERE AID=382 AND AF = 'a\\domain\test\1123.pdf';

       

      The indexes are used and the query tooks 0.01 seconds.

       

       

      So when the AF param starts with '\\' the indexes are not used.

       

      What happens here?

       

      Thanks

       

      Tom