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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:52:37+00:00 2026-06-13T16:52:37+00:00

I am using H2 database to increase performance and therefore I decided to load

  • 0

I am using H2 database to increase performance and therefore I decided to load data from MySQL to H2 database at run-time.

The scenario is that I created three tables as book, author, book_author. book_author is a many-to-many table.

The table book, author and book_author have records respectively 1000, 50000 and 50000.

The select query

select book.name 
from book, author , book_author 
where book.id = book_author.book_id 
and book_author.author_id = author.id 
and author.name = 'Charles Dickens'

Takes 7 minutes to execute.

I used spring-jdbc to create the H2 memory database.

EmbeddedDatabase database_01 = new EmbeddedDatabaseBuilder().
    setType(EmbeddedDatabaseType.H2).
    addScript("initial_script.sql").
    setName("database_01").build();

JdbcTemplate jdbcTemplate_01 = new JdbcTemplate(database_01);

Can somebody suggest why this much of time is taken and a way to optimize it ?

  • 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-13T16:52:39+00:00Added an answer on June 13, 2026 at 4:52 pm

    Did you create the right indexes? See also the documentation about index and how they are used in H2.

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

Sidebar

Related Questions

So, For the sake of performance, I'm using database sessions. I figure that while
Using Access Database Table ID Time 001 100000 001 100005 001 103000 001 102500
I'm currently using mysql w/ PHP because that's what I learned and haven't ever
So I'm trying to import some sales data into my MySQL database. The data
I want to increase performance of my sparql queries. I have to run all
I am using stored procedures to fetch information from the database. First I fetch
I am successfully querying data in a Sql Server CE database using the TableDirect
We have a client that is using CRM against a very large database. They
I'm optimising a bespoke database layer in a messaging system to increase performance. I'm
I have a result set returned from a database that takes a few seconds

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.