Hello i want to do this for a Report but i have 20,000,000 of records in my table and it causes an TimeOut in my application.
SELECT
T.transactionStatusID,
TS.shortName AS TransactionStatusDefShortName,
count(*) AS qtyTransactions
FROM
Transactions T
INNER JOIN TransactionTypesCurrencies TTC
ON T.id_Ent = TTC.id_Ent
AND T.trnTypeCurrencyID = TTC.trnTypeCurrencyID
INNER JOIN TransactionStatusDef TS
ON T.id_Ent = TS.ent_Ent
AND T.transactionStatusID = TS.ID
WHERE
T.id_Ent = @id_Ent
GROUP BY
T.transactionStatusID,
TS.shortName
as far as i know COUNT(*) causes a full table scan and it makes my query to take too much time, im Using MS SQL 2005, any help ?
[EDITED] The project leader tells me that the Query is just for one day it could help ?
thanks in advance