add index in order to be able to count unread entries without join

This commit is contained in:
Athou
2013-07-21 12:37:34 +02:00
parent 71d9d9aeea
commit e9cc6fd518
2 changed files with 8 additions and 1 deletions

View File

@@ -6,7 +6,7 @@
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<named-query name="EntryStatus.unreadCounts">
<query>select sub.id, count(s) from FeedEntryStatus s LEFT JOIN s.subscription sub where sub.user=:user and s.read=false group by sub.id</query>
<query>select s.subscription.id, count(s) from FeedEntryStatus s where s.user=:user and s.read=false group by s.subscription.id</query>
</named-query>
<named-query name="EntryStatus.existing">