AFAIK, under the default READ COMMITTED isolation level, a long-running SELECT keeps shared locks while reading data. Your INSERT and UPDATE statements require exclusive locks, so they wait until the SELECT finishes.
When you execute:
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
the session can read data without waiting for normal shared locks. This reduces blocking and allows concurrent inserts and updates to continue.
The impact is mainly on data consistency. READ UNCOMMITTED allows dirty reads. A query may read uncommitted data that is later rolled back. The query can also return inconsistent or incorrect results during concurrent modifications.
For example:
BEGIN TRAN;
UPDATE orders
SET amount = 1000
WHERE order_id = 1;
-- Another session using READ UNCOMMITTED reads amount = 1000
ROLLBACK;
The second session reads a value that never became permanent.
Execution time usually improves because sessions spend less time waiting on locks. Your inserts can continue while the long-running select is executing.
CPU and memory usage are normally not significantly increased by READ UNCOMMITTED. The isolation level itself is lightweight.
Rollback behavior does not change. Transactions still rollback normally. The only difference is that another session may already have read the uncommitted data before the rollback occurs.
No special execution rights should typically be required beyond normal query permissions.
A safer alternative would be enabling row versioning with:
ALTER DATABASE YourDatabase
SET READ_COMMITTED_SNAPSHOT ON;
This should prevent reader/writer blocking without allowing dirty reads. Readers access versioned rows from tempdb instead of waiting for locks.
You should also investigate why the SELECT runs for 45 minutes. The root cause might be missing indexes, table scans, outdated statistics, inefficient joins, or poor execution plans.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin