Barbara,
Look at the help topic for SET DATASESSION it lists all of the SETs that are scoped to the private DS. Then compate that to the SETs of the default DS. I;m suspecting SET DELETED is at fault.
>Thanks to Todd and Tom for their execellent suggestions. By using SYS(3054,1), I was able to verify that the query is optimized in the default datasession, but not in the private datasession. The weird thing here is, the code is unchanged. The only change I made between test runs was to change the datasession type of the form from 2 to 1. So I'm guessing there's some property of the datasession itself that needs to be tweaked.