UPDATE: I realized I should use Pouch's putAttachment and then read the attachment contents back using db.get with {attachments: true}. This "hides" the attachment contents inside an _attachments array on my documents. The db.query method seems to ignore this content (which is good) and Pouch's query performance is snappy again.I think my problem was that I was storing my attachments as regular documents and Pouch was having to load all of their (huge) contents any time I did a db.query.
--To view this discussion on the web visit https://groups.google.com/d/msg/pouchdb/-/RyGrIN7xOzkJ.
You received this message because you are subscribed to the Google Groups "PouchDB" group.
To post to this group, send email to pou...@googlegroups.com.
To unsubscribe from this group, send email to pouchdb+u...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "PouchDB" group.
To post to this group, send email to pou...@googlegroups.com.
To unsubscribe from this group, send email to pouchdb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pouchdb/-/oZ5Q96oNDU8J.
I added some further timing log messages into pouch.js and found that after adding two 5MB attachments to the attach_store the time to execute a single txn.objectStore(BY_SEQ_STORE).get(metadata.seq) call goes from 1ms to about 50ms. Obviously, that's not going to result in acceptable overall performance. I think this is probably IndexedDB's fault as the db.query function in Pouch completely ignores the attach_store (as it should). I'm running Chrome Version 21.0.1180.89 on OSX.Would it make sense to consider putting the attach_store in an entirely separate IndexedDB database rather than just in a separate objectStore? Maybe that would fix the performance problem.
--
You received this message because you are subscribed to the Google Groups "PouchDB" group.
To post to this group, send email to pou...@googlegroups.com.
To unsubscribe from this group, send email to pouchdb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/pouchdb/-/oTuRefOQ_74J.