C
Chris Aitchison
Hello,
I have two tables that I am needed to generate reports from, one has 10
million rows+ and the other has less than 200,000. These number of rows
will be increasing fairly steadily over time.
I have some queries that do counts and group bys along with some sums on
these two tables and join them based on what the query requires. I have
these queries running very quickly inside the query analyzer and have let
the index tuning wizard decide on the best indexed views and table indexes.
These indexes and views dramatically reduced the query times down to less
than a second.
However, these queries are called from a .net web application and when they
are called through the sqlconnection objects inside this web app the
execution timesout. I can copy the EXACT same t-sql code that timed out
into the query analyzer and they run quickly again.
The queries are all inside stored procedures, and to test I have been
calling them with exactly the same parameters from the web app and the query
analyzer.
Has anyone got any ideas as to why this is happening? I assume the
execution plan is not calculating correcty when it is being called by the
web application however this is very hard to confirm because as soon as I
paste the t-sql from the profiler into query anaylzer it runs quickly again.
Many thanks for any help that can be given on this issue,
Kind regards,
Chris Aitchison
I have two tables that I am needed to generate reports from, one has 10
million rows+ and the other has less than 200,000. These number of rows
will be increasing fairly steadily over time.
I have some queries that do counts and group bys along with some sums on
these two tables and join them based on what the query requires. I have
these queries running very quickly inside the query analyzer and have let
the index tuning wizard decide on the best indexed views and table indexes.
These indexes and views dramatically reduced the query times down to less
than a second.
However, these queries are called from a .net web application and when they
are called through the sqlconnection objects inside this web app the
execution timesout. I can copy the EXACT same t-sql code that timed out
into the query analyzer and they run quickly again.
The queries are all inside stored procedures, and to test I have been
calling them with exactly the same parameters from the web app and the query
analyzer.
Has anyone got any ideas as to why this is happening? I assume the
execution plan is not calculating correcty when it is being called by the
web application however this is very hard to confirm because as soon as I
paste the t-sql from the profiler into query anaylzer it runs quickly again.
Many thanks for any help that can be given on this issue,
Kind regards,
Chris Aitchison