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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:31:54+00:00 2026-05-23T19:31:54+00:00

I have a simple structure and i noticed that updating records in my database

  • 0

I have a simple structure and i noticed that updating records in my database takes too long to execute.

This is how my data class is defined:

public static final String TILE_MAP_UNIQUE_ID_FIELD_NAME = "tileMap_unique_id"; 
@DatabaseField (uniqueIndexName = "unique_tileMapCache", canBeNull = false)
int tileMap_unique_id;
public static final String TILE_MAP_LEVEL_ID_FIELD_NAME = "tileMap_level_id"; 
@DatabaseField (uniqueIndexName = "unique_tileMapCache", canBeNull = false)
String tileMap_level_id;
public static final String COLUMN_FIELD_NAME = "column"; 
@DatabaseField (uniqueIndexName = "unique_tileMapCache", canBeNull = false)
long column;
public static final String ROW_FIELD_NAME = "row";
@DatabaseField (uniqueIndexName = "unique_tileMapCache", canBeNull = false)
long row;
public static final String IMAGE_DATA_FIELD_NAME = "image_data";
@DatabaseField (dataType = DataType.BYTE_ARRAY, index = true, canBeNull = false)
byte[] image_data;
public static final String IMAGE_DATA_LENGHT_FIELD_NAME = "image_data_lenght";
@DatabaseField (index = true, canBeNull = false)
int image_data_lenght;
public static final String DATE_CREATED_FIELD_NAME = "date_created";
@DatabaseField(index = true, canBeNull = false)
Date date_created;
public static final String DATE_LAST_ACCESSED_FIELD_NAME = "date_last_accessed";
@DatabaseField(index = true, canBeNull = false)
Date date_last_accessed;
public static final String ACCESSED_COUNTER = "accessed_counter";
@DatabaseField(index = true, canBeNull = false)
int accessed_counter;

And this is the update statement somewhere in my application:

Dao<TileMapCacheData, Integer> updateTileMapCacheDataDao = dbHelper.getTileMapCacheDataDao();
UpdateBuilder<TileMapCacheData, Integer> updateBuilder = updateTileMapCacheDataDao.updateBuilder();
updateBuilder.updateColumnValue(TileMapCacheData.DATE_LAST_ACCESSED_FIELD_NAME, new Date());
updateBuilder.updateColumnValue(TileMapCacheData.ACCESSED_COUNTER, record.accessed_counter + 1);
updateBuilder.where()
.eq(TileMapCacheData.TILE_MAP_UNIQUE_ID_FIELD_NAME, tileMap.getUniqueId())
.and()
.eq(TileMapCacheData.TILE_MAP_LEVEL_ID_FIELD_NAME, tileMap.getLevelId(tileImage.tile.level))
.and()
.eq(TileMapCacheData.COLUMN_FIELD_NAME, tileImage.tile.column)
.and()
.eq(TileMapCacheData.ROW_FIELD_NAME, tileImage.tile.row);
updateTileMapCacheDataDao.update(updateBuilder.prepare());

The SQL looks like this:

UPDATE `tilemapcachedata` SET `date_last_accessed` = ? ,`accessed_counter` = 11 WHERE (((`tileMap_unique_id` = -1902272760 AND `tileMap_level_id` = '5' ) AND `column` = 24 ) AND `row` = -6 )

Does any one see where the problem is?
The .update() takes several seconds and it should be executed instantly.

Any idea would be great.

  • 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-23T19:31:55+00:00Added an answer on May 23, 2026 at 7:31 pm

    The only thing that I see is the byte[] image_data; field may hold some huge value that is slowing things down. But the update you show is not even touching the image_data field so I have no idea why it is taking so long.

    I would recommend enabling some of the logging in ORMLite to see if you can figure out where the time is going. See http://ormlite.com/docs/logging

    Also, you have a lot of indexes in this table including and index on the byte[] image_data. You might consider removing some of these indexes unless they are truly necessary.

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

Sidebar

Related Questions

I have a simple data structure (the properties are of course Dependency Properties): class
I have this structure of model objects: Class A: b = models.ManyToManyField(B) Class B:
I have a simple structure that is defined like so: typedef struct { int
I have a simple class that handles the connection being made between a client
If have a union that currently foresees some simple data types: union Value {
I have a large xml file (approx. 10 MB) in following simple structure: <Errors>
I have a very simple binary tree structure, something like: struct nmbintree_s { unsigned
I have a simple jquery/ajax request to the server which returns the structure and
I have some content sliding here. http://www.smallsharptools.com/downloads/jQuery/Slider/slider.html The HTML structure is simple. There is
I have simple win service, that executes few tasks periodically. How should I pass

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.