We had some performance issues with data saved in CouchDB. The issue was not couchdb, it was our code and failing to use the power of couchdb views. What we wanted to achieve is to generate a call_list for all calls to a service number. We did this by selecting all calls to that number and then in ruby code throwing out what didn’t match the Date range. The result of this was
not so much fun when we just want to get a list of the last seven days worth of calls.
The solution to this problem, assuming you are using the couch_potato gem, looks something like this:
1 2 3 4 5
The result of this little couchdb view is:
now that’s more like it :)