I am using MySQL server 5.1.45. And I am having a procedure with huge business logic. With less number of invocation of this procedure, my application is working fine, but when the number of invocations are getting increased this procedure is throwing Lock wait timeout exception.
My Question is will Procedure creates temporary tables dynamically..?
As in my procedure I am using Truncate statement which may cause to release all transactions.
I am not DBA, please help me out of this.
Procedure will not create temporary tables unless you tell it to create them. Perhaps it's best to split up that 'business logic' in a few different iterations.
Also make sure you are using proper indexes.