So I ended up putting where clauses on my subqueries so they don't handle too much data, it doesn't timeout anymore. However there is still a very large gap between the execution time of the query in PHP vs Squirrel.
Query timing out in php with sybase
Question
I am puzzled about a recent problem I'm getting, there's a query that has always work before and started acting up recently. It is timing out after 60 seconds. It is a very heavy query, however worked before and I have copy pasted the query into SQuirrel SQL Client and it takes about 39 seconds to return the results. I thought maybe the query is executed twice and it doesn't like it. So I did a test page with only this
sybase_connect('database', 'user', 'password', 'UTF');
print_r(sybase_query('sql'));
With the exact same query and it also time outs at 60 seconds. So I'm looking for an explanation on why this happens and perhaps a way to increase the timeout.
I have put a timeout of 120 seconds in freetsd.conf but to no avail it still times out after 60 seconds.
I have been trying to figure this one out for long and can't find any good solutions and the ones I find end up not working...
Help is greatly appreciated.
Edit: I am currently analyzing every subqueries in my big query to find the one the most problematic, however on every queries I test I notice a huge difference between execution with SQuirrel SQL Client and PHP ex: 33 secs for PHP, 11.493 secs for Squirrel.
Solution