SQL存储过程有问题吗? [英] SQL Stored Procedure Question?
本文介绍了SQL存储过程有问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果一次有1000个用户尝试执行存储过程,将会发生什么?
它将如何工作?
Hi,
What will happen if 1000 users trying to execute the stored procedure at a time?
How it will work? Single thread or multi thread or FIFO manner?
推荐答案
对此没有硬性规定.这取决于许多标准,例如什么是数据库(即Oracle,DB2,Sql服务器等)以及SP内部执行的操作是什么(插入/更新或只是选择).如果在SP内部选择操作,则SP可能会在多个线程上执行(这是数据库所在的地方),因为插入/更新语句需要对表进行排他锁,因此它始终是FIFO.
There is no hard and fast rule for this. This depends on many criteria like what is database (i.e Oracle, DB2,Sql server etc ) and what is the operation performed inside the SP(insert/update or just a select). In case of select opration inside SP the SP may execute over multiple threads(this is where data base comes into picture) where as insert/update statements require exclusive lock on tables therefore this will always be FIFO.
这篇关于SQL存储过程有问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文