Kai Wu <[EMAIL PROTECTED]> wrote:
2. The table schema is simple
    TABLE MID(id VARCHAR(8),scts VARCHAR(12),daddr VARCHAR(20))

    the scenario is it needs first select the "id" by
    select id from MID where scts= .. AND daddr=...

    after the id field is retrieved, this entry can be deleted by
    delete from MID where id=..
    or delete from MID where scts=.. AND daddr=..

     Apparently "delete" does some repeated work, ie, to locate the
matching entry from the table
     (it might be helpful to set id as PRIMARY KEY, but since
insert/delete dominates, its overhead might be higher)

Try

select rowid from MID where scts= .. AND daddr=...
delete from MID where rowid=...

ROWID is a column representing internal B-Tree key. Every table has it, and every table is "indexed" by it, by nature of the internal data representation.

Igor Tandetnik

Reply via email to