etl in case sql query is to slow