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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:55:28+00:00 2026-06-08T18:55:28+00:00

Facts Database: PostgreSQL (latest) Programming language: Java Problem statement (simplified) We have 2 tables

  • 0

Facts

  • Database: PostgreSQL (latest)
  • Programming language: Java

Problem statement (simplified)

We have 2 tables – overview and details. There could be millions of rows in “overview” and each row of “overview” can have millions of rows associated with it in “details”. The foreign key details.overview_id refers to overview.id. Most queries are of the general form

SELECT * FROM details WHERE overview_id = xxx AND details.id > yyy AND details.id < zzz;

If we have a single table for details, the queries will be too slow (although the queries on details are almost always on primary keys).

More on the nature of DB activities: INSERT and UPDATE on overview happens infrequently. INSERT on details happen at a rapid pace, while UPDATE on the same table almost never happens and bulk DELETE happens sometimes.

What we already have

In the past we used raw SQL to partition the table “details” against each row in “overview”. (In practice, we did not actually partition, instead we created new tables based on a template. These tables did not have any column called overview_id (saving storage space), instead we had a separate table that did the mapping between overview.id and the table-name of the specific partition table.) So, as you can understand, the partitions had to be generated on the fly as new rows were inserted in overview and partitions were dropped as rows were deleted from overview. All of this was managed inside the application. The application-database interaction has been blazing fast, but the application code is fairly complex, implying it is hard to maintain. Also, with raw SQL lying around everywhere, it is hard to scale the DB horizontally – we have to reinvent what most JPA providers have already done.

Current goal

Currently we are exploring options for a mechanism by which this partitioning can happen behind the scene – possibly by a JPA provider (I understand that this is not part of the JPA spec), so that we can focus on the application while the underlying framework/layer takes care of the scalability issues.

I looked at openJPA Slice and EclipseLink. Both of them provide partition (shard) management across hosts. We certainly need that. But we also need partition management within a single host. However, if there is a better or more elegant solution to this or if there is a totally different angle to look at this, I will be really glad to know about that.

I will appreciate any insight you can provide.

Thanks.
Prajesh

  • 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-08T18:55:30+00:00Added an answer on June 8, 2026 at 6:55 pm

    Thank you all for your comments/answers till date. We decided to stick to what we already have (see the section named “what we already have”), with minor modifications.

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

Sidebar

Related Questions

I have a ASP.NET MVC 3 application using NHibernate over a PostgreSQL database. There
Facts I have an mvc project. I am using jquery. The problem $('#ModalData').empty(); is
I have a database full of facts such as: overground( watfordjunction , watfordhighstreet ,
I have a database with several tables, each one containing columns that may not
I have run into an interesting problem. I have inherited a database for daemon
I have been begun programming in Prolog lately and find the language very dry.
I have problem with connecting to a Firebird database. It works perfectly, when I
I have a backend process that maintains state in a PostgreSQL database, which needs
Facts: I have a desktop app backed by a SQL CE database. Many of
I have a prolog database file with lots of facts knowledge.pl . For example:

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.