Question

Is it the norm for a query like:

update A set TextField = 'U'

to take 2 minutes to execute on a table with 2M records? The table has no PK, no indexes, but I'm not using where either.

Was it helpful?

Solution

2M records updated in 2 minutes, that's around 16k updates per second, which IMO is quite decent.

Most DBMS won't just return when they committed the write operation to cache, but wait until the OS confirms that the write operation was in fact carried out. That feature is quite important to ensure data integrity, which you'll agree with me is a critical quality of a db server. In contrast, select statement can often be served from cache.

By the way, you may find this presentation by Bruce Momjian interesting, it explains nicely what to think about when you select a DB server. It's PostgreSQL centric, but what he explains is valid for all makes of database servers.

EDIT: and another interesting source of info is this presentation by Microsoft's Bob Dorr - which among other interesting things states that 98% of IO in SQLServer is async.

Wrt your observation that updating a column that already contains a value vs one that was set to null, this SO article may contain useful info - the data type you used for your TextField column probably has a significant influence.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top