title: Hibernate with partitioned table
body: <p>Using database postgresql 9.5.</p>
  
  <p>I have a table <code>employee_shift</code> with rows <strong>110966498</strong>, so to improve inserts I've partitioned this table on months for 20 years (Jan 2000 to Dec 2020 ie 240 partitioned tables so far).This is on a <code>column</code> date in table.</p>
  
  <p>Now that my inserts are faster(done by native query) but my existing DAO layer is using HQL which hits the <code>employee_shift</code> table rather than hitting <code>employee_shift_2010_10</code> (year_month), hence my select statements are relatively much much slower because it checks in all partitions.</p>
  
  <p>Is there an way hibernate can directly hit the <code>employee_shift_2010_10</code>, if I use select statements using <code>date</code> column?</p>
  
  <p>What are my other options to make my selects faster in this case?<br></p>