May 27, 2016 at 2:30 am
Hi,
is there away to set database to not issue any locks/blocks on all tables?
i don't want that insert will block select and insert will block another insert and delete statement.
i'm not afraid of dirty reads etc..
THX
May 27, 2016 at 2:33 am
There is no way to do that in a relational database.
I would rather focus on the reason why you're getting blocked, find the root cause and fix it. Can you describe your scenario in more detail?
-- Gianluca Sartori
May 27, 2016 at 2:50 am
spaghettidba (5/27/2016)
There is no way to do that in a relational database.I would rather focus on the reason why you're getting blocked, find the root cause and fix it. Can you describe your scenario in more detail?
OK 🙁
well the application we use have a specific database that store rows for manipulation when they run queries. this is a shared tables for all users.
the rows that the user insert to those tables are not shared by any other user (select/insert/update). it's just like that you use the tempdb for every user session to handle his query.
an example - user insert 300,000 rows for manipulation during the insert other users blocked for insert or select or delete or update until his insert is finished, and when he finished his manipulation the program delete those 300,000 rows and then we get locks again until the delete finished..
May 27, 2016 at 3:03 am
You really wouldn't want no locks at all. Rows deleted while they're still being inserted, updates affecting some of the rows they should because the rest are still being inserted, etc, etc, etc.
For your shared 'temp' table, that's often a bad idea for exactly the reasons you're seeing. May I suggest you look at redesigning it so that the users use temp tables, or give every user their own schema with their own table that they can insert, update, delete at their leisure.
Alternately look at how the table is indexed and make sure that SQL isn't having to scan the entire table to find User7's rows.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 27, 2016 at 3:09 am
GilaMonster (5/27/2016)
You really wouldn't want no locks at all. Rows deleted while they're still being inserted, updates affecting some of the rows they should because the rest are still being inserted, etc, etc, etc.For your shared 'temp' table, that's often a bad idea for exactly the reasons you're seeing. May I suggest you look at redesigning it so that the users use temp tables, or give every user their own schema with their own table that they can insert, update, delete at their leisure.
Alternately look at how the table is indexed and make sure that SQL isn't having to scan the entire table to find User7's rows.
the problem is that we cannot do any thing here this is how the program work and we can't interact with the queried to put no lock etc.. it's closed program!
May 27, 2016 at 3:28 am
Have you tried read committed snapshot? Won't help with deletes blocking inserts, but will help with reads.
And have you checked the indexing to make sure it supports the queries? Poor indexing often results in blocking problems.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 27, 2016 at 8:22 am
Mad-Dog (5/27/2016)
GilaMonster (5/27/2016)
You really wouldn't want no locks at all. Rows deleted while they're still being inserted, updates affecting some of the rows they should because the rest are still being inserted, etc, etc, etc.For your shared 'temp' table, that's often a bad idea for exactly the reasons you're seeing. May I suggest you look at redesigning it so that the users use temp tables, or give every user their own schema with their own table that they can insert, update, delete at their leisure.
Alternately look at how the table is indexed and make sure that SQL isn't having to scan the entire table to find User7's rows.
the problem is that we cannot do any thing here this is how the program work and we can't interact with the queried to put no lock etc.. it's closed program!
I am curious about what kind of program this is.
May 27, 2016 at 12:42 pm
Lynn Pettis (5/27/2016)
Mad-Dog (5/27/2016)
GilaMonster (5/27/2016)
You really wouldn't want no locks at all. Rows deleted while they're still being inserted, updates affecting some of the rows they should because the rest are still being inserted, etc, etc, etc.For your shared 'temp' table, that's often a bad idea for exactly the reasons you're seeing. May I suggest you look at redesigning it so that the users use temp tables, or give every user their own schema with their own table that they can insert, update, delete at their leisure.
Alternately look at how the table is indexed and make sure that SQL isn't having to scan the entire table to find User7's rows.
the problem is that we cannot do any thing here this is how the program work and we can't interact with the queried to put no lock etc.. it's closed program!
I am curious about what kind of program this is.
the program called Priority
May 27, 2016 at 1:59 pm
Mad-Dog (5/27/2016)
Lynn Pettis (5/27/2016)
Mad-Dog (5/27/2016)
GilaMonster (5/27/2016)
You really wouldn't want no locks at all. Rows deleted while they're still being inserted, updates affecting some of the rows they should because the rest are still being inserted, etc, etc, etc.For your shared 'temp' table, that's often a bad idea for exactly the reasons you're seeing. May I suggest you look at redesigning it so that the users use temp tables, or give every user their own schema with their own table that they can insert, update, delete at their leisure.
Alternately look at how the table is indexed and make sure that SQL isn't having to scan the entire table to find User7's rows.
the problem is that we cannot do any thing here this is how the program work and we can't interact with the queried to put no lock etc.. it's closed program!
I am curious about what kind of program this is.
the program called Priority
Who sells it? Just doing a Google search doesn't come up with anything in the first page that even looks like an application program.
May 27, 2016 at 2:31 pm
Lynn Pettis (5/27/2016)
Mad-Dog (5/27/2016)
Lynn Pettis (5/27/2016)
Mad-Dog (5/27/2016)
GilaMonster (5/27/2016)
You really wouldn't want no locks at all. Rows deleted while they're still being inserted, updates affecting some of the rows they should because the rest are still being inserted, etc, etc, etc.For your shared 'temp' table, that's often a bad idea for exactly the reasons you're seeing. May I suggest you look at redesigning it so that the users use temp tables, or give every user their own schema with their own table that they can insert, update, delete at their leisure.
Alternately look at how the table is indexed and make sure that SQL isn't having to scan the entire table to find User7's rows.
the problem is that we cannot do any thing here this is how the program work and we can't interact with the queried to put no lock etc.. it's closed program!
I am curious about what kind of program this is.
the program called Priority
Who sells it? Just doing a Google search doesn't come up with anything in the first page that even looks like an application program.
it's an erp software.
May 27, 2016 at 3:31 pm
If you have a support agreement, call them up and scream at them.
Eddie Wuerch
MCM: SQL
July 31, 2016 at 12:47 am
if i setup in the index page lock = false and row lock = false will it help reduce the locks on those tables?
July 31, 2016 at 5:43 am
Mad-Dog (7/31/2016)
if i setup in the index page lock = false and row lock = false will it help reduce the locks on those tables?
Reduce the number, yes. Reduce the impact, no. With those two false, SQL has to take table-level locks.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 31, 2016 at 6:20 am
Eddie Wuerch (5/27/2016)
If you have a support agreement, call them up and scream at them.
+1000 to this. Call the software provider up and show them what's going on with their software and have them fix it. Remembering that they caused the perf problems in the first place, be prepared to show them both the cause and a recommended fix if you want to continue to use their software.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 31, 2016 at 8:23 am
they know about the problem and for now they can't fix the problem.
table scan is not good because some tables can have even millions rows for they temp table.
what i can set to false that will reduce the locking and wouldn't do table scan?
Thanks
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply