couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <>
Subject Re: Tips for optimizing Filtered Replication?
Date Fri, 02 Nov 2012 16:28:04 GMT

On Nov 2, 2012, at 5:49 AM, Tim Hankins <<>>

Can anyone comment on whether these times are expected, and if not, suggest
how I might optimize things in order to get better performance?

I’ve found that date/time parsing is slow on all platforms, and can be a performance bottleneck.
It’s best if you can avoid it.

The usual workaround in CouchDB is to store dates in a format that sorts properly with plain
string collation, i.e. some type of “YYYY-MM-DD HH:MM:SS” style. Then there’s no need
to parse dates to compare them, you just compare strings.

An alternative is to store dates as numeric timestamps (e.g. seconds since an epoch). This
can be even faster, and lets you quickly do computations like the time between two dates,
but a lot of people dislike it because it’s not human-readable.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message