Text this: Sensor Queries: Algebraic Optimization for Time and Energy