/** * Optimize the full condition. This will add the full condition to the * filter condition. * * @param fromOuterJoin if this method was called from an outer joined table */ void optimizeFullCondition(boolean fromOuterJoin) { if (fullCondition != null) { fullCondition.addFilterConditions(this, fromOuterJoin || joinOuter); if (nestedJoin != null) { nestedJoin.optimizeFullCondition(fromOuterJoin || joinOuter); } if (join != null) { join.optimizeFullCondition(fromOuterJoin || joinOuter); } } }
/** * Remove all index conditions that can not be used. */ public void removeUnusableIndexConditions() { for (int i = 0; i < allFilters.length; i++) { TableFilter f = allFilters[i]; setEvaluatable(f, true); if (i < allFilters.length - 1 || f.getSession().getDatabase().getSettings().earlyFilter) { // the last table doesn't need the optimization, // otherwise the expression is calculated twice unnecessarily // (not that bad but not optimal) f.optimizeFullCondition(false); } f.removeUnusableIndexConditions(); } for (TableFilter f : allFilters) { setEvaluatable(f, false); } }