time-consuming SQL insert operation

Started by
1 comment, last by frob 3 months, 1 week ago

Let's say you have a SQL table with an index on the field "username".

Is it true that eventually you'll have some really time-consuming inserts when the hash table has to resize itself?

Hash table resize is O(n), I think.

Thanks.

Mike C.http://www.coolgroups.com/zoomer/http://www.coolgroups.com/ez/
Advertisement

Those are some very vague terms.

“Eventually” all kinds of work will need to be done. Data layout optimization, hash computation, indexing, defragmentation, and other database maintenance tasks don't necessarily need to take place during a transaction. Database services have all kinds of background work to keep things speedy.

What is “eventually”? How big is big enough on your hardware? What does “really time consuming” mean to you?

Rebuilding an index takes about as long as it takes to read through the table. If it is on a spindle disk you might get 200MB/s reads, a SSD might be 500 MB/s, NVMe might be 6 GB/s. Usually you need quite a large database before regular maintenance tasks start to be notable performance impacts. Get enough gigabytes and all processing takes a little time.

This topic is closed to new replies.

Advertisement