We have this MySQL SP, which calls a nested SP. It seems it does NOT perform well under load.
It is possible that this SP becomes slow under load because it calls a nes
It seems nested SPs was NOT the main bottleneck.
I've changed temp tables to MEMORY engine and it really did the trick and made AMAZING difference. Solution was suggested in
https://dba.stackexchange.com/questions/52825/can-mysql-nested-sp-be-a-bottleneck/52863?noredirect=1#52863
create temporary table areas (
id int not null,
code varchar(30),
name varchar(100),
shortName varchar(100),
levelid int not null,
sortOrder int not null,
key (id)
) ENGINE=MEMORY;