Optimized queries to improve performance time significantly