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

  • Home
  • SEARCH
  • 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 9051839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:00:55+00:00 2026-06-16T13:00:55+00:00

I have a database, that isn’t really fast, and I have a big CSV

  • 0

I have a database, that isn’t really fast, and I have a big CSV of about 65000 rows. I need to crosscheck these for existence and to update the database when needed.

  • In the CSV, there is a column that contains the database IDs. It is always a 1:1 relationship.
  • The CSV may hold new input for the database, so it can happen that there are no DB entries for it.
  • I cannot loop through the CSV and check each row, because it is too slow.
  • Getting all results from the database at first and storing them to loop through every time won’t work, because that will pull alot of RAM.

How can I do the following:

  • Check if a row in the CSV has a database entry. If so, write it away to another CSV file.
  • If the row has no database entry, write it to a different file.
  • Keep the timespan within 5 minutes, preferably shorter.

The CSV has alot of columns (for example 70), but I only need column 5 for crosschecking the IDs. I have tried to first loop through the CSV file and then check it with the database, but that is too slow. It can take over 10 minutes. I have also tried to get all entries from the database, and loop through those. Withing the loop, run through the CSV (using a BufferedStream), and checking it. This does decrease the time significantly (5 min max.), but will not be able to record the entries that do not exist in the database.

Is there any way I can do this while keeping the speed up?

  • 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-06-16T13:00:56+00:00Added an answer on June 16, 2026 at 1:00 pm

    Late answer, but I have fixed it this way: I am pulling the CSV columns that I need into a DataTable. Then I fetch all rows that I need to check (it has a certain number I can filter on), and run through those database rows. Each row will check for the corresponding ID in the DataTable and put the data in a new CSV. After that, the row in the DataTable will be deleted. In the end I have a CSV with rows that do exist and will be imported into the system, and a DataTable that will be exported to a CSV with rows that need to be added.

    Thanks for Gregory for helping me getting on the right track.

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

Sidebar

Related Questions

I have a Database that contains data about articles , structures and manufacturers .
OK I hope this isn't too specific. I have a database driven CMS that
I have a bunch of rows in a database that all contain an element
I have model that isn't reliant on a database. It fetches data using a
I have a CSV file with information about our inventory that gets changed locally
I need to specify a path in a database.yml file that isn't in the
I have database cleanup that I need to do within a running service thread.
i have DataBase function that calculate distance by coordinates CREATE OR REPLACE FUNCTION distance(lat1
I have a database that has around 10k records and some of them contain
I have a database that had 15 years of cruft stuffed into it by

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.