int lookPos = numOptimizables;
int lastSwappedOpt = -1;
Optimizable nextOpt;
for (nextOpt = optimizableList.getOptimizable(nextOptimizable);
!(nextOpt.legalJoinOrder(assignedTableMap));
nextOpt = optimizableList.getOptimizable(nextOptimizable))
{
// Undo last swap, if we had one.
if (lastSwappedOpt >= 0) {
firstLookOrder[joinPosition] = idealOptimizable;