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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:19:41+00:00 2026-05-26T08:19:41+00:00

Have a problem with querying data via Ormlite DAO, when there are few thousand

  • 0

Have a problem with querying data via Ormlite DAO, when there are few thousand results.

Code:

List<Point> pl = db.getPointsDAO().queryBuilder().where().
            eq("route_id", croute).query();

When I want to get a large list of points List<Point> pl for current Route croute I have to wait like 40 sec for 40.000 points.

where Point.class is:

@DatabaseTable(tableName = "points")
public class Point extends BaseEntity {
    @DatabaseField(generatedId = true)
    private Integer point_id;
    @DatabaseField(canBeNull = false)
    ...
    @DatabaseField(canBeNull = false)
    private Double dose;
    @DatabaseField(dataType=DataType.DATE_STRING, format="yyyy-MM-dd HH:mm:ss")
    public Date date;
    @DatabaseField(canBeNull=true,foreign=true)
    private Route route;

public Point() {
    super();
};
... ...
}

and Route.class is:

@DatabaseTable(tableName = "routes")
public class Route extends BaseEntity {

    @DatabaseField(generatedId = true)
    private Integer route_id;

    @DatabaseField(canBeNull = true)
    private String name;

    @ForeignCollectionField(eager = false)
    ForeignCollection<Point> points;

    public Route() {
        super();
    }
    ... ...
}

Some ideas what I’m doing wrong?

Thanks,
Toni

  • 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-05-26T08:19:42+00:00Added an answer on May 26, 2026 at 8:19 am

    Couple of things to try @toni.

    1. I’d consider storing your Date as a DATE_LONG instead of a string which will save 40k string/date conversions.
    2. @Selvin is right that if there is some way for you can iterate through the database, this may lower your memory requirements and speed things up. See dao.iterator() in ORMLite.
    3. I’d use int and double primitives to lower your GC for each of your objects although I doubt it will make much of a difference.
    4. Try loading in 1000 points, then 10000, then 20000 to see if there is a drop off in performance at some point. That will tell you that you are hitting up against memory limits.
    5. Use the adb logcat utility to see if you can see the GC times to see if you are just thrashing the collector. Anything that you can do to lower your memory usage will help then. Look for lines like:
      GC_EXPLICIT freed 4140 objects / 216560 bytes in 114ms
    6. Although I doubt it is the issue, could you be missing an index? Try adding a index = true on the foreign route field.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem when I try insert some data to Informix TEXT column via
I have a problem for querying records into mysql explanation below The user could
I have a simple problem when querying the SQL Server 2005 database. I have
We have very strange problem, one of our applications is continually querying server by
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
In my MVC application I have a problem with passing data from view to
We have a list of x,y pairs. Every pair represents a point on a
I have a simple data set, a few collections, not more than 20 documents
I have a special list (a sort of queue, as in the data structure,
I have problem in some JavaScript that I am writing where the Switch statement

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.