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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:33:43+00:00 2026-06-10T05:33:43+00:00

I have a problem where I have a lot of data to graph. The

  • 0

I have a problem where I have a lot of data to graph. The chart is setup such that initially only a small number of points are plotted, but you can “zoom” in to get more points for a specific date range (this happens via an AJAX request to a Java backend)

I have thought of two approaches and would love some feedback as to which might be more efficient:

  • Simply perform a new sql query for each request with the date range in question
    OR
  • Preload all the records for all date ranges into ORM classes within my Java framework. Add these to a binary search tree. Then when the user makes a request, simply perform the binary search.

I assume the database has some kind of tree-based indexing already, but with the second approach I could avoid the overhead of the repeated db calls. Thanks for any help!

  • 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-10T05:33:44+00:00Added an answer on June 10, 2026 at 5:33 am

    The best way to see is to profile both solutions, but my instinct is that your DBMS will do this much fast than you can do it. DBMS’s are designed specifically to handle queries like this very very fast. Their optimizers are probably better than what you would implement in Java.

    This is assuming your DB is properly configured and optimized to handle queries like the ones you described. I suspect that the cost of repeated DB calls would not be enough to offset the DBMS performance.

    Letting the DMBS do this search is also cleaner, since it minimizes the code you need to write yourself.

    Again, the best way to know for sure is to quickly prototype both solutions and profile.

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

Sidebar

Related Questions

i have small problem i.e. their is one celltable with lot of data it
I have a web page that displays a chart with a lot of data
I have a peculiar problem, which I think that a lot of other people
I'm plotting ~768 points for a graph using CGContextStrokePath. The problem is that every
In an application that I'm writing I have to load a lot of data
I have a lot of data that I want to disseminate to many different
I have a bizarre problem. I use a lot of session variables so I
I have trouble finding a solution for the following problem: I have a lot
I have read a lot of related topics here regarding this problem but I
I have run into a strange problem, i am creating a lot of dynamically

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.