Re: HOW CAN I DO THIS FASTER On Apr 11, 11:46*pm, Jorge Reyes <jorg_re...@hotmail.com> wrote:
> Hi i need Ideas for making faster this store procedure, first Let me
> tell you the scenario:
>
> I have 2 tables, origin(i lookup and calculate information) and
> destiny(insert or update the calculated information), this are the
> details:the origin table has 2,242.013 rows (since January) and the destiny
> table has 7,488 rows, this is just April 01 (00:00-23:59) so the
> problem is my sp PR_POP_UB_TOTGRALBYSIDNID it takes at least 3 hours running, please
> give me ideas to decrease the running time. Thanks in advanced
(1)Remove "cursor" from the stored proc and apply temp table logic
there. i.e. write a code to apply the logic using temp table instead
of cursors. cursors perform very slow compare to the plain sql
(2)Get showplan for the proc and find out if any queries inside the
proc preforms "Table Scan". You can find showplan for a proc without
actually executing it by turning "set fmtonly" to on
-HTH
Manish Negandhi
[TeamSybase Intern] |