November 18, 2011 at 2:16 pm
Hello guys,
Please give some inputs for an newbie.
The plan is to redevelop 10 PL/SQL package hundred page code, without changing the func. and the specifications, can we remove all use off temporary table and dynamic SQL? Main issue is to make the performance much better.
If anyone has come up with such scenario please give some inputs or links, if it can be achieved using cursors or smth else.
please advice,if can it be achieved and how difficult is the task?
Thanks & Regards,
Andy
November 18, 2011 at 2:23 pm
andyron (11/18/2011)
Hello guys,Please give some inputs for an newbie.
The plan is to redevelop 10 PL/SQL package hundred page code, without changing the func. and the specifications, can we remove all use off temporary table and dynamic SQL? Main issue is to make the performance much better.
If anyone has come up with such scenario please give some inputs or links, if it can be achieved using cursors or smth else.
Cursors are not a replacement for temporary structures. They're a different beast entirely and they can only slow you down (you're thinking Oracle where they're more useful). Temp tables also can usually help optimize your code. However, in this case, I've never seen the code. I have no idea what their use is so I don't know if you can optimize them away.
Dynamic SQL if coded well isn't really that much different then standard SQL, but it's a lot less secure and more annoying to manage. Under most circumstances you can remove dynamic SQL. Again, I haven't seen the code though so I can't speak to THIS code.
please advice,if can it be achieved and how difficult is the task?
Sounds like it's going to be very difficult for you, you seem inexperienced in T-SQL and SQL Server. You might look into hiring a contractor for a week or two to do an initial review with you and make sure you start off on the right foot, and then work from the guidelines he recommends.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
November 18, 2011 at 2:26 pm
PLSQL is very cursor oriented,where the same operation in can be redesigned to do the same work in a set based manner, which is typically several orders of magnitude faster than a cursor.
rewriting your code depends, of course on what it is doing. why are there 10 temp tables? why are there cursors and what are they doing?
we can probably offer hints and bits and pieces, but in a general sense, the answer to your question is yes...you cna get rid of it and do it faster, most likely.
Lowell
November 18, 2011 at 2:38 pm
Thank you very much for the quick replies.much appreciated.
would you please like to view the code once and comment.
I will PM my email address.
Regards
November 18, 2011 at 2:56 pm
General forum 'rules' - post it publicly and we'll comment publicly so that others who read will also benefit.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 18, 2011 at 2:59 pm
ok thanx.no idea,how i can post such long code.
November 18, 2011 at 3:01 pm
Put it in a text file or .sql file and upload it (edit attachements)
November 18, 2011 at 3:23 pm
I have attached the file.
The code in question is the attachment 1 called code.
Can it be done on the lines of code 2?
Thanks
November 18, 2011 at 3:26 pm
Please post as text files. People are usually frisky about opening 3rd party office files from programmers ;-).
November 18, 2011 at 4:00 pm
Good to know that buddy
Viewing 10 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy