Hi,
I am observing a strange behaviour with SQL server.
When i fire a query on SQL 2005
SELECT TOP 5000 * FROM ::fn_trace_gettable
'C:\traces\TraceFile50MB\tracefile_1.trc', 1) WHERE starttime >
'2008-04-22 11:21:22.05'
it takes a few milliseconds to execute, but when i change the '>' sign to
'<' in the where clause sign it takes more than 7 seconds. To be more precise
the new query would become
SELECT TOP 5000 * FROM ::fn_trace_gettable
'C:\traces\TraceFile50MB\tracefile_1.trc', 1) WHERE starttime <
'2008-04-22 11:21:22.05'
I have seen this behaviour in almost all my trace files.
Please let me know as to how this query can be optimized and why is this
taking so much time.
.
Re: SQL Query Performance ...Execute the query and see which is faster. ... I support the Professional Association of SQL Server and it's community of SQL Server professionals. ... > I want to select Fleet_Id and Fleet_Name from fleet table> Where the current user has privilege. ... (microsoft.public.sqlserver.programming)
Re: SQL 2000 manual start job sort order ... As you might know, without ORDER BY, SQL Server is free to optimize and execute a query in any way ... then the optimizer has to ... (microsoft.public.sqlserver.server)
Re: Closing a connection BEFORe command execution has completed ... closing the connection with Connection.Close does not close the connection--it simply releases it back to the pool so the engine will continue to fill the cache--but it's not that large so the operation might simply hang resources on the server until the connection is reused. ... The problem is, since all of the Execute methods are synchronous, there is no way to interrupt the query or action command process. ... Because of the way TDS and SQL Server responds to cancel requests your operation might not be immediately "stoppable"--SQL Server might have some cleanup to do before releasing control and resources. ... (microsoft.public.dotnet.framework.adonet)
Re: Could not find stored procedure ... To add on to Dejan Sarka post, Simply execute the below query in Query ... > loin is mapped to a specific db user dbo, so SQL Server searches dbo.name ... (microsoft.public.sqlserver.server)
Re: why is sqldatareader so slow ? ... How long does it take to execute the query with the SQL Server tools?... maybe you lack some indices that could make the query... > how to make it work faster?... (microsoft.public.dotnet.languages.csharp)