Skip to content

Commit

Permalink
Revise suggested indexes for document models
Browse files Browse the repository at this point in the history
These indexes are based on the queries present in each document's manager class.
  • Loading branch information
jmikola committed Dec 13, 2011
1 parent 2928424 commit 4f24291
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Resources/config/doctrine/Message.mongodb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@

<indexes>
<index>
<key name="thread.$id" order="asc" />
<key name="createdAt" order="desc" />
</index>
<index>
<key name="sender.$id" order="asc" />
</index>
<!-- MessageManager::markIsReadByThreadAndParticipant() -->
<index>
<key name="createdAt" order="desc" />
</index>
<index>
<key name="thread.$id" order="asc" />
<key name="metadata.participant.$id" order="asc" />
</index>
<!-- MessageManager::getNbUnreadMessageByParticipant() -->
<index>
<key name="isSpam" order="asc" />
<key name="metadata.participant.$id" order="asc" />
<key name="metadata.isRead" order="asc" />
</index>
</indexes>

Expand Down
5 changes: 4 additions & 1 deletion Resources/config/doctrine/Thread.mongodb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
<index>
<key name="createdAt" order="desc" />
</index>
<!-- ThreadManager::findThreadsCreatedBy() -->
<index>
<key name="isSpam" order="asc" />
<key name="createdBy.$id" order="asc" />
</index>
<!-- ThreadManager::getNotDeletedByParticipantExpression() -->
<index>
<key name="metadata.participant.$id" order="asc" />
<key name="metadata.isDeleted" order="asc" />
</index>
</indexes>

Expand Down

0 comments on commit 4f24291

Please sign in to comment.