mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
add index in order to be able to count unread entries without join
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -339,4 +339,11 @@
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="athou" id="create-count-index">
|
||||
<createIndex indexName="user_read_sub_index" tableName="FEEDENTRYSTATUSES">
|
||||
<column name="user_id" />
|
||||
<column name="read_status" />
|
||||
<column name="subscription_id" />
|
||||
</createIndex>
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
||||
|
||||
Reference in New Issue
Block a user