[SQL] Improve column pruning in the optimizer.