Following 2 statements took 400ms to be excuted on a 350M MIPS CPU and it is a memory database:
"DELETE FROM tblEvent_type WHERE eguid in (SELECT rowid FROM tblEvent_basic WHERE sguid=11);"; "DELETE FROM tblEvent_group WHERE eguid in (SELECT rowid FROM tblEvent_basic WHERE sguid=11);"; (An index has been created on tblEvent_group(eguid) , no other index so far.) And also I notice that "(SELECT rowid FROM tblEvent_basic WHERE sguid=11)"`was excuted twice ,so I'd like to try to split the subquery to something like below to see if there will be any performance gain: result = exe_sql "(SELECT rowid FROM tblEvent_basic WHERE sguid=11);"; exe_sql "DELETE FROM tblEvent_type WHERE eguid in (result) exe_sql "DELETE FROM tblEvent_group WHERE eguid in (result) How to get the parmater (result) binding to follwing statement in sqlite? "DELETE FROM tblEvent_group WHERE eguid in (?) #how to bind result here I am using sqlite3 C API directly. -- View this message in context: http://www.nabble.com/how-to-break-subquery-into-2-simply-query-tp24422352p24422352.html Sent from the SQLite mailing list archive at Nabble.com. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users