I have a big table that has many columns. In different use cases I need to load different columns from this table, but usually I don’t need all of the columns. So now I think I should select the necessary columns from this big table.
For example I have a simple POJO like UseCase1 and I use this named query:
SELECT NEW UseCase1(t.a, t.b, t.c) FROM MyBigTable t
In update statements I also update only a, b, c fields.
So the question is, this is a good solution, to improve performance if I can’t change the table? And will this improve the performance? 🙂
We had similar situations, and you can see the performance improvement using this technique in 2 cases.
Like @JB told, when we speak about performance nothing can be finalized without measuring it.These 2 point were my general experiences.