Is the time cost constant when bulk inserting data into an indexed table?

Posted by SiLent SoNG on Stack Overflow See other posts from Stack Overflow or by SiLent SoNG
Published on 2010-03-19T14:28:49Z Indexed on 2010/03/19 14:31 UTC
Read the original article Hit count: 235

Filed under:
|
|
|

I have created an archive table which will store data for selecting only.

Daily there will be a program to transfer a batch of records into the archive table. There are several columns which are indexed; while others are not.

I am concerned with time cost per batch insertion:
- 1st batch insertion: N1
- 2nd batch insertion: N2
- 3rd batch insertion: N3

The question is: will N1, N2, and N3 roughly be the same, or N3 > N2 > N1?

That is, will the time cost be a constant or incremental, with existence of several indexes?

All indexes are non-clustered.

The archive table structure is this:

create table document (
   doc_id   int unsigned primary key,
   owner_id int,  -- indexed
   title    smalltext,
   country  char(2),
   year     year(4),
   time     datetime,

   key ix_owner(owner_id)
}

© Stack Overflow or respective owner

Related posts about mysql

Related posts about indexing