That cracked it. It in fact did make the query faster, there were more deleted records in the table than I realised.
THanks for your help.
>Probably the query is missing an index on deleted(). If you have SET DELETED ON, the condition "... and not deleted()" is added implicitly.
>
>Adding the index on both tables would make your query full R.O., according to sys(3054). However, it will also make the query slower, at least in many cases. For an explanation why this is so, you may want to read my article about Rushmore, at
http://www.levelextreme.com/wconnect/wc.dll?FournierTransformation~2,84,14,8109.
>
>Hilmar.