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 4616598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:00:18+00:00 2026-05-22T02:00:18+00:00

I have 2 big CSV file with millions of rows. Because those 2 CSVs

  • 0

I have 2 big CSV file with millions of rows.
Because those 2 CSVs are from MySQL, I want to merge those 2 tables into one Document in couch DB.

What is the most efficient way to do this?

My current method is:

  1. import 1st CSV
  2. import 2nd CSV

To prevent duplication, the program will search the Document with the key for each row. after the row is found, then the Document is updated with the columns from the 2nd CSV

The problem is, it really takes a long time to search for each row.
while importing the 2nd CSV, it updates 30 documents/second and I have about 7 million rows. rough calculation, it will take about 64 hours to complete the whole importing.

Thank You

  • 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-22T02:00:19+00:00Added an answer on May 22, 2026 at 2:00 am

    Another option is simply to do what you are doing already, but use the bulk document API to get a performance boost.

    For each batch of documents:

    1. POST to /db/_all_docs?include_docs=true with a body like this:

      { "keys": [ "some_id_1"
                , "some_id_2"
                , "some_id_3"
                ]
      }
      
    2. Build your _bulk_docs update depending on the results you get.

      • Doc already exists, you must update it: {"key":"some_id_1", "doc": {"existing":"data"}}
      • Doc does not exist, you must create it: {"key":"some_id_2", "error":"not_found"}
    3. POST to /db/_bulk_docs with a body like this:

      { "docs": [ { "_id": "some_id_1"
                  , "_rev": "the _rev from the previous query"
                  , "existing": "data"
                  , "perhaps": "some more data I merged in"
                  }
                , { "_id": "some_id_2"
                  , "brand": "new data, since this is the first doc creation"
                  }
                ]
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to convert a big csv file from gb2312 encoding to UTF-8 encoding.
I have an quite big CSv File I want to have in Google Maps
I have a big string (let's call it a CSV file, though it isn't
I have a big csv file which lists connections between nodes in a graph.
I have a big csv file with datetime and value recorded every 10 seconds.
I have quite a big network in a CSV file. It containt 450k nodes
I have a big csv file where the first column is the day of
http://img32.imageshack.us/img32/6649/workspace1001.png big version I have this product data in a csv file, but some
I've written a big sql script that creates a CSV file. I want to
I have some big .csv files and I am trying to put it into

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.