Optimized product edit query