improve support for "FOR EACH FIRST" and similar cases
#1 Updated by Eric Faulhaber over 11 years ago
Currently, instances of looping queries like FOR EACH...FIRST... are converted to CompoundQuery. This works logically, but it is an inefficient implementation. We need a smarter conversion (and runtime support), which recognizes that only a single record is being found within the inner loop/join. The idea is that we convert to a smarter, set-based query that still is adaptive (i.e., can shift between preselect and dynamic mode). This will require some serious consideration and design work.
Note that this is purely an optimization; the current form of conversion will work, but it could stand to be less ugly and more efficient.