How can I make my SQL statement smaller so my server doesn't time out?

  • a.sophiewirth - Friday, July 27, 2018 6:50 AM

    @mike-2: That's alright, I suppose the internet has made us all a little more cynical.
    Ah, I understand, thank you for explaining! Database structures and using them in bigger contexts is still extremely new to me so I understand basically nothing as of yet. 

    @steve-2: I have adapted your code and it seems to be working amazingly well, just the INNER JOIN had to become a LEFT JOIN, Thank you a lot for your help! I am very grateful for it, I was really stuck here.

    @luis, Yeah I think my topic was worded badly, I understand it wasn't really the length of my code that caused the timeout. Your example has been really helpful in figuring out how I can chain JOINTS better together. Thank you!

    Glad I could help.  Often, getting a query to perform is a matter of understanding how the query engine works, and in most RDBMS products, such engines often do better with either good indexing or queries that lead the query engine down a certain path.   When you can vary that path, you stand a good chance at learning what your query engine likes and doesn't like.   Those kinds of experiments are often the best way to learn...

    Steve (aka sgmunson) 🙂 🙂 🙂
    Rent Servers for Income (picks and shovels strategy)

Viewing post 16 (of 15 total)

You must be logged in to reply to this topic. Login to reply