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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:29:53+00:00 2026-06-14T07:29:53+00:00

I am in the process of migrating data from one database to another. The

  • 0

I am in the process of migrating data from one database to another.

The data I am migrating is reviews for versions of products.

There are many versions for each review. there are 23K distinct reviews, and 60k versions that have reviews meaning roughly every 3 versions share a review.

In my Java application the host database contains the Versions that have a reviewId that is associated with a review on the review db.

I have a Hashmap<Integer, Integer>, and every time I import a review from the review db I add it to the map using map.put(reviewId, hostId).

Before I import from the review db I check to see if its in the hashmap if it is I use the already imported review. This starts to get really slow after a while, and I am wondering if perhaps using a temp table is more efficient. Or if there is another way that is more efficient.

Here is the code:
https://gist.github.com/4064373

Thoughts, suggestions?

  • 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-14T07:29:55+00:00Added an answer on June 14, 2026 at 7:29 am

    A MySQL temporary table will in the best case be implemented as a hash map as well. But in contrast to the Java hash map, the implementation will be prepared to handle a larger number of columns. And you have the overhead of communicating with MySQL. So to answer the title of your question, I’d expect a Java HashMap to be more efficient if you’re accessing your data from the application. For correlation of data within the SQL server, things are different.

    But as Jon Skeet pointed out in his comment, a simple hash map from integers to integers should not be a serious performance bottleneck for the kind of application you’re describing. So chances are that something else is written in a suboptimal way. I don’t see any obvious problems at first glance, but then, there is a lot of methods you call, and in theory, any one of them might be to blame.

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

Sidebar

Related Questions

I am migrating from one system to another and in the process, I will
We're in process of migrating one stable project from Castle Windsor 2.5.2 to 3.0.
I am working on migrating a bunch of data from an old database into
I am in the process of migrating a large amount of data from several
I'm in the process of migrating my application's database from MySQL to NoSQL(MongoDB). However,
I was just testing the process of migration of data from M/S to HRD,
I am in the process of migrating from a Django FastCgi setup in Apache
I'm in the process of migrating a rather extensive REST service from WCF to
THE TASK: I am in the process of migrating a DB from MS Access
I am in the process of migrating a SQL 2008 R2 database between software

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.