couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elf <>
Subject Is speed falls on dynamic views?
Date Sun, 19 Apr 2009 11:56:56 GMT
I have multithreaded application doing something with documents.
Documents must be accessed one at once. So, i need flag to mark
document is in use. Also, processing thread can shutdown/hang in
unclean state (document will be leaved in "used" state).
I have made documents' flag "date_check" with timestamp of processing
start. View, selecting non-checking documents will count, how long
document is processing. If alot, date_check is simply ignored and
document can be processed again.

So, i have something like in view:

if (doc.date_check < (new Date().getTime()/1000 - 2*60*60)) {
      emit('not checked', 1);

As I understand, it's impossible to cache this view results, so this
view must be recounted on every call.
Am i right?

Is there better idea to get document-level locking?

Best regards

View raw message