>>>The column DATEI is defined as C(240) and has an index on UPPER(DATEI).
>
>To use the index, you need the filter to be UPPER(datei) as well.
>
>
WHERE UPPER(Datei) = UPPER(lcPfad)
>
>With no index on Datei, a filter on Datei does a table scan.
That will force Rushmore to kick in, but still runs some unneccessary UPPER() calls following the btree.
local lcUpperPfad
lcUpperPfad = UPPER(lcPfad)
SELECT Datei FROM ("DBCNAME!" + lcTabelle) ;
WHERE UPPER(Datei) = m.lcUpperPfad;
INTO CURSOR TMP_DOKNAME
is somewhere between having good habits and premature optimization ;-))