Set foreign keys to fetch.LAZY type (don't know if it helps performance).
View now has column numOfClasses and numOfSamples, for better performance.