SQLServer and executeQuery

Curt Hagenlocher curt at hagenlocher.org
Tue Aug 7 16:33:03 EDT 2001


"Brent L Johnson" <brent at bjohnson.net> wrote:

> I've put millisecond timers around lots of the code and I've found
> that the executeQuery() statement is taking around 2 minutes 40
> seconds to run my query.  This is not an acceptable time to wait
> for a simple report.  Could anyone give me any pointers of where
> else to look to fix this problem?

This sounds like a SQL Server query optimization issue.  You may
be able to get more help from comp.databases.ms-sqlserver (or
.sybase, as appropriate).

Generally, you will want to place your query in a stored procedure
and will want appropriate indexes so that the optimizer makes the
right choices.  If it still doesn't do the right thing, you can
force the query plan using the option () and (index=xxx) notations.

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the FreeTDS mailing list