sqlite(android)更新速度极慢

时间:2011-11-10 15:37:09

标签: android sqlite

我在android sqlite中有这个表:

db.execSQL("CREATE TABLE " + IMAGE_TABLE_NAME + " (" + TABLE_IMAGE_COLUMN_ID + " INTEGER PRIMARY KEY," +
                                                       TABLE_IMAGE_COLUMN_FULL_PATH + " TEXT UNIQUE, " + 
                                                       TABLE_IMAGE_COLUMN_FOLDER + " TEXT, " +
                                                       TABLE_IMAGE_COLUMN_IMAGE_NAME + " TEXT, " +
                                                       TABLE_IMAGE_COLUMN_LAST_MODIFIED_DATE + " INTEGER, " +
                                                       TABLE_IMAGE_COLUMN_IS_PROCESSED + " INTEGER, " +
                                                       TABLE_IMAGE_COLUMN_PROCESS_ORDER + " INTEGER, " +
                                                       TABLE_IMAGE_COLUMN_DATE_PHOTO_TAKEN + " INTEGER, " + 
                                                       TABLE_IMAGE_COLUMN_ORIENTATION + " INTEGER, " + 
                                                       TABLE_IMAGE_COLUMN_WIDTH + " INTEGER, " + 
                                                       TABLE_IMAGE_COLUMN_HEIGHT + " INTEGER, " + 
                                                       TABLE_IMAGE_COLUMN_RATING + " INTEGER, " + 
                                                       TABLE_IMAGE_COLUMN_SIZE + " INTEGER, " + 
                                                       TABLE_IMAGE_COLUMN_CAMERA_MODEL + " TEXT, " + 
                                                       TABLE_IMAGE_COLUMN_CAMERA_MAKE + " TEXT, " + 
                                                       TABLE_IMAGE_COLUMN_MICRO_THUMBNAIL + " BLOB) ");

当我尝试执行简单的更新语句时:

update Image set IsProcessed=1

大约需要20秒。这看起来很慢,对我来说很慢。

以下是几条可能有用的评论:

  • 数据库在sdcard上
  • BLOB字段填充了大约2-4kb的项目
  • 表格中的项目数量约为450

任何帮助如何加快速度的人都会非常感激。

0 个答案:

没有答案