title: JPA Native query is very slow
body: <p>I've a parent child relationship between tables in JPA. I've to fetch the parent table records based on a condition in child table. So I've<br>
  <code>String LOOKUPQUERY = "select * from ParentEntity p where p.status_id in (select st.id from status st where st.status ='required') order by created desc"; 
  @Query(value = LOOKUPQUERY,nativeQuery=true)
  List&lt;parentEntity&gt; requiredLookup();</code></p>
  
  <p>This is taking 18 seconds. If I run the same on db it's less than a second. Any suggestion on optimizing this?</p>