I have a very complex SQL query for one of my programs, and I am trying to see if there is anyone who can optimize the speed. Currently, the query takes 3 minutes, and the total execution time I have to complete my processing is 5 minutes (the overall process is on a 5 minute cron job, so the SQL query takes the majority of the time).
The query is very long so I have posted it in a GIST here: [url removed, login to view]
You'll see there are a lot of "OR symbol = 'mysymbol'" WHERE clauses, and perhaps that might be the cause. I'm not sure, thats why I'm here.
I own the server, and the DB, so I'm happy to provide access to the winning bidder.
I am using Azure SQL if it matters...