Viewing 15 posts - 1 through 15 (of 33 total)
Entirely a poor article. Wordy, unclear, and pretentious. You have some good ideas. Unfortunately, you fail to express them clearly.
Even worse, you tell us how wrong the "MUCK" practice is...
March 24, 2006 at 8:23 am
Ok I guess we're getting somewhere... It's not the UDF or the SP that's causing the problem.
When I use constants for @StartTime/@StopTime (either nulls, or dates like '1/1/1960' and...
August 18, 2005 at 12:56 pm
Changing the clustered key is not a good option for us, but I will play with indexes some more.
And pardon if this is being a newb, but I don't understand...
August 18, 2005 at 12:42 pm
Now it's getting weirder... I moved the VehicleStartDate and VehicleStartMileage to [Common].dbo.tblVehicle so now the join to tblVehicleStart has been eliminated. Now the straight query (no UDF or SP) runs in...
August 18, 2005 at 12:24 pm
Perhaps not. But 135K has to be doable in under 30 seconds of CPU time. If online stores can inventory millions of items...
August 18, 2005 at 12:08 pm
It will primarily be used as the record source for an Access report (where the default timeout is 30 seconds, plus people will get fidgety if it takes much longer than...
August 18, 2005 at 11:53 am
dbcc dropcleanbuffers
go
select * from fn_vehicledistances('6/1/2005','6/15/2005')
------------
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
DBCC execution completed. If DBCC printed error messages, contact your...
August 18, 2005 at 11:31 am
Actually... here is the plan from the query (not inside the UDF):
Table 'tblVehicleStart'. Scan count 1, logical reads 2, physical reads 2, read-ahead reads 0.
Table 'Worktable'. Scan count 30238, logical...
August 18, 2005 at 10:49 am
set statistics io on
set statistics time on
dbcc dropcleanbuffers
go
select * from fn_vehicledistances(null,null)
dbcc dropcleanbuffers
go
select * from fn_vehicledistances('1/1/1960','1/1/2010')
set statistics io off
set statistics time off
go
---------------
SQL Server Execution Times:
CPU time = 0 ms, elapsed...
August 18, 2005 at 10:21 am
42 rows each. They both return exactly the same results. This is why I don't understand how one can possibly be twice as fast since it's the same query.
August 18, 2005 at 10:00 am
Alright, here's what you asked for.
Method #1, 14 seconds: Here is the entire UDF. What I did to get 14 seconds is pull...
August 18, 2005 at 9:52 am
Is there a good reason why the the UDF takes 30 seconds to run when pass in @StartTime=null and @Stoptime=null, but it only takes 14 seconds to run when I copy the code...
August 18, 2005 at 9:22 am
Here is, I believe, all that pertains to this query:
CREATE TABLE [tblMerged] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[VIN] [varchar] (17) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[StartTime] [datetime] NULL ,
[StopTime] [datetime] NULL...
August 16, 2005 at 10:29 am
Pardon the newbness but you'll have to define "ddl," sorry. And yeah I probably could change the clustered index as long as it doesn't destroy anyone else's query efficiency.
August 16, 2005 at 10:10 am
Certainly. This is the workplan of the original query I gave a couple posts back (without the changes we talked about).
|--Compute Scalar(DEFINE: ([Expr1009]=[Expr1007]-If ([tblVehicleStart].[StartMileage]<>NULL) then [tblVehicleStart].[StartMileage] else [Expr1008]))
|--Parallelism(Gather...
August 16, 2005 at 10:05 am
Viewing 15 posts - 1 through 15 (of 33 total)