Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DocumentFiles stored in MongoDB should have an index on the document field #338

Open
laserval opened this issue Jun 12, 2014 · 0 comments
Open
Labels

Comments

@laserval
Copy link
Contributor

Attatchments, i.e. DocumentFiles, are stored using GridFS in MongoDB, which creates a separate dbobject in the collection documents.files containing the file metadata. In this dbobject, the document that this attachment belongs to is stored in the document field. Queries on this field can be expensive, as it is not indexed.

We've seen queries taking several seconds, which were completely eliminated by setting an index on the document field.

One risk with introducing more indexes in Hydra is that each stage currently creates a new index (see #230 ). An additional index on the attachments will decrease the max number of stages by 1.

It might also be relevant to create an index on the filename, or a compound index on document ID and filename.

laserval pushed a commit to laserval/Hydra that referenced this issue Aug 29, 2014
laserval pushed a commit to laserval/Hydra that referenced this issue Sep 11, 2014
laserval pushed a commit to laserval/Hydra that referenced this issue Jan 9, 2015
laserval pushed a commit to laserval/Hydra that referenced this issue Jan 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant