Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

sql server 2008 - query cost (relative to the batch)

hi experts, can you explain me
query cost (relative to the batch)
i attached image

this query is better
select *
from dbo.Data
where ADate > DATEADD(day, -1, GetDate())
go

but i do not understand:
query cost (relative to the batch)
queryCOSTrelativeBATCH.jpg
SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enrique_aeo
enrique_aeo

ASKER

I enable set statistics IO on
--query 1
Table 'Data'. Scan count 1, logical reads 1141,

--query 2
Table 'Data'. Scan count 1, logical reads 838

query2 is better, but i do not understand
Query cost relative to the batch = 66%
should not be less?
please experts,
as I interpret the difference in percentages and the results of the statistics?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
but in this case
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial