Programing help in SQL

Xpage

Senior member
Jun 22, 2005
459
15
81
www.riseofkingdoms.com
Does anybody have any idea what the fastest code "style" is for SQL. I know of CURSOR which si slow as hell and WHILE but are there any other methods. Thankfully I don't code but my friend does, so I'm trying to see if I can help him improve our game's code at all. Current our query run time is 20 minutes which is too long in my opinion though I will admit it does have to do alot in that one query.
 

tkdkid

Senior member
Oct 13, 2000
956
0
0
Try adding an index. I would suggest keeping the query as simple as possible and putting the logic in code. Split it up into multiple queries if possible.
 

KLin

Lifer
Feb 29, 2000
30,207
558
126
Post the query. I'm curious to see what a 20 minute query looks like.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I have a query that will take a hour or more to give results, if not timeout.

select * from tablename;

we have tables that will actually cause my machine to time out after giving a low virtual memory error. (Mostly only on finacial transaction tables)

To optimize sql you are going to have to look at some factors.

1) What database are you running? Are there any special features for said database you can use?
2) Can it be done with a stored procedure?
3) Can you optimize your index?
4) are you even using an index?
5) Could this be done using a view?
6) If this query is used a lot, is it being used consitantly (always written the same, caps, and all) and is it being cached?

Thats the crash course basics with looking at optimizing a sql query.
 

Xpage

Senior member
Jun 22, 2005
459
15
81
www.riseofkingdoms.com
Thanks for all the help. I'll see what I can get to post here for you guys to critique. Sadly I'm the game deisgner but not the code designer or coder, so my knowledge in this area is very tiny, thus my psot for your help. I am sure my coder hasn't thought of everything and any optimization is a good one. stay tuned for more information
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |