Fix last run filter on top SQL queries