Insun Kang uttered:

Hi.

I tested big deletes performance and big insert performance on a Windows CE
device in various cache size configurations.
( 1MB, 100KB, 50KB )

Insert 3000 records performs within 23sec, 43sec and 61sec, with respect to
each cache size configuration.
However, delete 1000 records among 3000 records performs within about
0.4secs for all cache size configurations.

Why does delete operation outperform insert operation? and how come the
delete operation is independent of cache size?
I think the updating indices costs are almost same in both insert and delete
operations.
Can anybody explain the reason?


Delete without constraints is implemented using a DROP of the table followed by recreation of the table. Thus, all pages used by the table are simply marked as unused and added to the freelist.

Adding to the free list will touch each page at most once, and thus caching adds no benefit (and has no loss for a smaller cache.)

Inserting may touch each page multiple times, for such operations as rebalancing the tree. Therefore, a larger cache will be beneficial on inserts.

Christian


--
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \

Reply via email to