I have a simple propram that issues sqlite update command every few seconds.
The platform is linux based with kernel 2.6.33 and sqlite version is 3.4.1.
The db file is on the partition with EXT3 format. Usually it takes only 11-13
ms to execute the update commands. Recently I upgrade the kernel to 3.4.6 but
find one problem. It takes about 43-51 ms to finish the update command now.
That is, the write performance is almost four times slower that kernel 2.6.33.

The following is source code of the function I used for updating
sqlite. Is there
anything I do wrong or does anyone have the similar problem? Thanks a lot.

int my_db_update_progress(int value)
{
        sqlite3* db;
        char* zSQL = NULL;
        int ret = 0;
        int changed = 0;

        zSQL = sqlite3_mprintf("UPDATE MY_TASK SET progress = %d WHERE \
                task_pid = %d;", value, getpid());
        ret = sqlite3_open("/etc/mydb.db", &db);
        if (ret) {
                sqlite3_free(zSQL);
                return -1;
        }
        sqlite3_busy_timeout(db, 20000);
        ret = sqlite3_exec(db, zSQL, NULL, NULL, NULL);
        if (sqlite3_total_changes(db))
                changed = 1;
        sqlite3_close(db);
        sqlite3_free(zSQL);
        if (ret != SQLITE_OK || !changed)
                return -1;
        return 0;
}

Regards,
Kevin
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to