Hullo all, Run on a single processor, the following query is quite fast:
// Select Statement sprintf(sql_statements, "select lp.%s, lp.%s, lp.%s, lp.%s, pb.%s from %s lp, %s pb " "where lp.%s > ? and lp.%s=pb.%s " "order by lp.%s, lp.%s, pb.%s", ARTID_LATENT_PARENT_XPOS, ARTID_LATENT_PARENT_YPOS, ARTID_LATENT_PARENT_RADIUS_OF_INFLUENCE, ARTID_LATENT_PARENT_FR_TIME_STAMP, ARTID_LATENT_PARENT_PIXEL_BIN_NUM, ARTID_LATENT_PARENT_TABLE, ARTID_LATENT_PARENT_PIXEL_BIN_TABLE, ARTID_LATENT_PARENT_FR_TIME_STAMP, ARTID_LATENT_PARENT_SOURCE_ID, ARTID_LATENT_PARENT_SOURCE_ID, ARTID_LATENT_PARENT_XPOS, ARTID_LATENT_PARENT_YPOS, ARTID_LATENT_PARENT_PIXEL_BIN_NUM); When concurrency is introduced (simply running the query on several processors against the same database - say 300 instances of it) causes a massive slow down with significant fluctuations in time between instances. Only reads are done (i.e. queries) - no writes. How does one optimize concurrency in sqlite3 The database is opened as follows: //sql_rc = sqlite3_open(database_name, &sql_db); sql_rc = sqlite3_open_v2(database_name, &sql_db, SQLITE_OPEN_READONLY, NULL); if (sql_rc != SQLITE_OK) { fprintf(stderr, "Function:%s can't open database:%s, error:%s\n", FLAG_ON_LATENT, database_name, sqlite3_errmsg(sql_db)); sqlite3_close(sql_db); return(FAIL); } -rosemary. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users