sensor-listener:optimize all of the sql selects to leverage sql_select_row()