Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 579729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:23:49+00:00 2026-05-13T14:23:49+00:00

I’ve seen it mentioned in a couple of places that it takes a while

  • 0

I’ve seen it mentioned in a couple of places that it takes a while to generate a view the first time it’s referenced in couchDB, but I haven’t found any sort of estimate of how long it should take. More specifically, I’m trying to test a view I created and it takes so long to load that I cannot tell if I screwed up the view, or if I’m just too impatient to let the view finish generating. The map function for the view is pretty simple:

function(doc){
  emit(doc.name, null);
}

I know that all the documents have a name field because I did some validation before importing them, and there is no reduce function. There are about 11,000 documents in the database, and I basically want to sort them by name.

I navigated to the view’s page in futon last night and let it work for about 30 minutes without seeing any results. It seems pretty strange that it should take even that long, since a result shows up relatively quickly when the above function is used for a temporary view. Should it take this long to generate a view in CouchDB? If not, what could lead to a situation like this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:23:50+00:00Added an answer on May 13, 2026 at 2:23 pm

    It turns out there was no problem with the map function, but the culprit was actually the reduce function. I created the view using couchapp, and the default reduce function was the following:

    function(key, values, rereduce){
    
    }
    

    Notice that it doesn’t actually return anything. Without a return value, CouchDB was apparently running the map/reduce cycle over and over again, and never actually stopping. Removing the reduce function from the view fixed the problem.

    And to answer the original question, it did not take very long to generate the view. On my computer it took ~20 seconds.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
This could be a duplicate question, but I have no idea what search terms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.