如何多次避免存储过程执行 [英] How to avoid stored procedure executions by multiple times

查看:97
本文介绍了如何多次避免存储过程执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,

我要求你提出建议和想法来完成我的请求。



在我的网站上运行那些国家 。在我的工作流程中,在多个表中有太多插入,每天所有分支,他们每天都会得到报告。我用它来存储过程来生成报告。 becoz有很多连接标准。



我的观点是我有30个分支,所以每天最少40-50次执行。我的计划是单次执行存储过程然后获取所有分支的记录,然后在客户端尝试生成报告时将其推送到一个全局表意味着我们可以从全局表中获取报告数据。因为它是直接的(选择*来自globaltable,其中日期和分支而不是那么多的连接



这是正确的方式或者请建议我任何其他方法来实现这一目标以提高系统性能。



我尝试过:



需要一个想法,以避免相同的程序执行多次。

Hi Experts,
I'm request you the suggestions and ideas to accomplish my request.

in my website running all over the countries . in my work flow there is too many inserts in multiple tables , everyday all the branches, they are getting daily basis report. which i was used stored procedure to generate report. becoz there is lot of joins criteria.

my point is i've 30 branches so everyday minimum 40-50 executions will occur. my plan is single time i've execute the stored procedure then getting records for all branches and push it to one global table after that whenever client side trying to generate the report means we can get the report data from global table . because its direct (select * from globaltable where date and branch instead of so much of joins)

is this right way or please suggest me any other way to achieve this to improve system performance.

What I have tried:

Need an idea to avoid same procedure execute multiple times.

推荐答案

由于SP同时运行,你必须在这里有创意...

想想这样的事情:

As SPs borned to run simultaneously you have to be creative here...
Think of something like this:
1. Check if there is a temp table by name of today date
2. No - create one and run the rest of the SP to push data into, then select data from the table
3. Yes - select data from the table


这篇关于如何多次避免存储过程执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆