pierr <pierr.c...@gmail.com> wrote:
> Igor Tandetnik wrote:
>>
>> pierr wrote:
>>> 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.)
>>
>> You might benefit from an index on tblEvent_basic(sguid). An index on
>> tblEvent_group(eguid) may actually hurt performance.
>>
>>
> Igor,
> This is really what I found. Why an index on tblEvent_group(eguid)
> hurted the performance?

Because whenever you change a table, indexes on it also need to be 
updated, so more work has to be done. Indexes are always a trade-off: 
they speed up SELECTs, but slow down INSERTs, UPDATEs and DELETEs.

Igor Tandetnik



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

Reply via email to