Optimized queries by filter replacement.