I have a select query that retrieve huge amount of data based upon some joins with other tables and all the tables are being used by other processes(Some of them are writing data to these tables and some other are retrieving from). The simultaneous operations put locks on the tables.
Is there any way in the select query that can optimize the query response time even there is an write/Shared lock on the table? Can "With (NOLOCK)" with table help?
Thanks Manoj
You can try these options too
- Remove unnecessary left joins
- Remove where clause if it can be used along with Inner join condition - May create indexes on your columns - Select desired columns, avoid using * for all columns - Avoid giving large lengths for your columns