couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramanadham, Radhika" <radhika.ramanad...@emc.com>
Subject RE: running views return nothing with couchdb1.5.1
Date Wed, 21 May 2014 15:40:41 GMT
I get "True" when I run GET /_config/query_server_config/reduce_limit  for both- couchdb server
1.5.0 and 1.5.1.

Also, I just have a very simple design doc with 2 views. Even this doesn’t work on couchdb
1.5.1 and works ok on cocuchdb 1.5.0

def createDesignDocForErrors():
    design = db.design('errors')
    resp = design.put(params={
        "_id":"_design/errors",
        "language": "javascript",
        "views":
        {
            "by_test_id": {
                #"map": "function(doc) { if (doc.type == 'error')  emit(doc.test_id, doc.errors)
}"
                "map": "function(doc) { if (doc.type == 'error')  emit(doc.test_id, doc.error_count)
}",
                "reduce" : "_sum"
            },

            #http://10.247.32.72:5984/longevity/_design/errors/_view/by_testid_starttime?group=true
            "by_testid_starttime": {
                "map": "function(doc) { if (doc.type == 'error')  emit([doc.test_id,doc.start_time],
doc.error_count) }",
                "reduce" : "function(keys, values) {return (values[0])}"
            }
        }
     })

I can't run this view either. Says, problem accessing a view.

-----Original Message-----
From: Dave Cottlehuber [mailto:dch@jsonified.com] 
Sent: Wednesday, May 21, 2014 11:34 AM
To: user@couchdb.apache.org
Subject: Re: running views return nothing with couchdb1.5.1

 
> Hi Radhika,
>  
> What does the server status say in futon? (i.e. does it note that the 
> views are building or not?)
>  
> One side comment, the reduce functions that you posted will likely not 
> do what you expect when a rereduce is run. I would suggest using 
> _stats (preferable solution, 
> http://couchdb.readthedocs.org/en/latest/couchapp/ddocs.html#builtin-r
> educe-functions
> ).
>  
> Cheers,
> Mike
>  

As Mike pointed out, you will see noticeably better performance using the builtin function.
 

Do you see any errors, in particular Reduce output must shrink more rapidly or reduce_overflow_error
? 

https://couchdb.readthedocs.org/en/latest/couchapp/views/nosql.html#aggregate-functions 

It’s possible you have a different config on each box, for the reduce heuristic;  

GET /_config/query_server_config/reduce_limit is what you would be looking to compare between
the boxes.

Thanks Bob & Alex for reminding me of the error messages!

A+
Dave



Mime
View raw message