Criteria Distinct on (column) [message #1745102] |
Wed, 05 October 2016 08:15 |
Asaf Natan Messages: 3 Registered: October 2015 |
Junior Member |
|
|
Hi,
looking at the sql eclispelink has genrated when applying select(..).where(..).distinct(true) , i have found out that i get much better performance if i just distinct on the id column and the orderby field making sure i have an appropriate index on a5,a1,
Meaning :
SELECT DISTINCT ON (a1,a5) ........... ORDER BY a5
here the id is a1 and the order by field is a5,
i was wondering is there any way to achieve this using eclipselink ,
i have seen the group by operator and reading the info online you can use it as a distinct replacement , the issue is that i have not been able to reproduce the performance of the query above using it....
Thanks.
|
|
|
Powered by
FUDForum. Page generated in 0.01348 seconds