Performance of Redshift Stored Procedure is not upto mark
Hi All, In my stored procedure, I have scursor which loops through the table and each record will go through many IF Conditions and as per result I will move further using fetch next while being inside loop itself.I am not able to do BULK UPDATE cause my requirement demand row level processing.It is performing good for just One id, but i have large number of ids which needs to be processed by this sp and time taken is beyond the expectation.How to speed up this stored procedure in Redshift?
Row by row processing is not ideal in Redshift or really any MPP database. Can you provide sample code and maybe we can help you convert it into a set based approach?
Thank you for posting your question.
To further dive deep on the specifics of the slow execution of this stored procedure, I would ask that you open a support case and include the output of:
SHOW PROCEDURE sp_name
Invalid operation when creating Stored Procedureasked 3 years ago
Call a stored procedure in Redshift from GlueAccepted Answerasked 3 years ago
output log for RDS stored procedure
fail a glue job if the called stored procedure fails
Can a Redshift stored procedure executing dynamic SQL use error exception handling to recover work & continue processing?Accepted Answerasked 6 months ago
Redshift stored procs best practice for transactions locking tables and avoiding serialization isolation violationsasked 4 months ago
rdsadmin_run_apex_rest_config procedure not workingasked 5 months ago
Programmatically Running a Stored Procedure in Redshiftasked 3 years ago
Performance of Redshift Stored Procedure is not upto markasked 2 months ago
Trigger stored procedure upon glue job succe