Reputation: 4039
I have table "TRANSACTION" in Sql Server 2008. Approximately, 6 records in 1 second are inserted into this table. (Since it is financial transactions table) So, in 1 day, 500.000 records are inserted. Table is partitioned weekly.
This table is heavily used for many kind of select (with NOLOCK, of course), insert, update operations.
Do you think the query below may slow down other critical select, insert, update operations on the same table? I think, even if the query below lasts too long, other select queries are not going to slow down since this query does not lock the table. But I cannot be sure, and ask to you.
Note that, the columns in the select list are NOT indexed on table.
SET @END_DATE = GETDATE()
SET @START_DATE = DATEADD(HOUR, -24, @END_DATE)
SELECT Column1, Column2, Column3, Column4, COUNT(*) FROM [TRANSACTION] WITH(NOLOCK)
WHERE TRANSACTION_DATE BETWEEN @START_DATE AND @END_DATE
GROUP BY Column1, Column2, Column3, Column4
Upvotes: 0
Views: 3258
Reputation: 21766
Obviously it WILL more or less slow down all the operations on the server.
The only queries which will be locked while your query lasts is schema change queries against your table.
Personally I recomment you to create index on columns Column1, Column2, Column3, Column4, Transaction_date to run grouping faster, like this:
CREATE INDEX iName on [TRANSACTION](Column1, Column2, Column3, Column4, Transaction_date)
Upvotes: 0
Reputation: 27294
Running any query on the server will use CPU / Memory / IO, so in essence anything you run can have an impact on other queries being executed.
You are definately going to read in ~500k rows from your own figures, the row size you could calculate and you could even get a rough idea of how many pages this data would therefore be stored on. You would have to cross check against the query plan to make sure it was at least not doing a full partition scan, otherwise it would be 3.5 million rows scanned into memory.
Will that put you outside of your SLAs? we have no way of telling that, only you can determine that through suitable load testing.
Upvotes: 3