Viewing 15 posts - 16 through 30 (of 2,617 total)
27Million
58,000 per day
Depending on the width of the rows and the number of indexes on the table, deleting a day's worth of rows should typically take no more than...
November 17, 2024 at 5:59 pm
How many rows are added to the table each day? And how many rows are currently in the table?
November 16, 2024 at 6:04 pm
Perfect .. works great ..
Many Thanks...
I’ve revised my original response to correct the delete statement - perhaps it could serve as an example.
I’ve also added WITH (NOLOCK)
on the...
November 16, 2024 at 2:40 pm
This is throwing an error:
-- Populate the batch table with the next set of IDs to delete DELETE TOP (@BatchSize) OUTPUT DELETED.Id INTO #BatchToDelete FROM #ToDelete;
Msg 102, Level 15,...
November 16, 2024 at 2:14 pm
Jonathan can your example include 2 fields I mention above? so I could use a 4hr window as also suggested.
Thanks.
Certainly! Simply include the criteria in the WHERE clause of...
November 15, 2024 at 8:29 pm
When performing deletions on large tables, it is essential to delete rows using the clustered index (in this case, PK(Id)) and process the deletions in small batches. This approach ensures:
Efficiency:...
November 15, 2024 at 7:11 pm
Not quite the same result but has all the info:
SELECT *
FROM #STOCKS1 AS T1
FULL JOIN #STOCKS2 AS T2
...
November 14, 2024 at 4:19 pm
Thank you, Scott and Frederico, for the helpful advice!
I’ll take a closer look at the query plan tomorrow to verify whether it’s performing a seek or just a scan. I’ll...
November 12, 2024 at 10:49 pm
Thank you for the detailed reply - it’s very helpful!
Just to clarify, the queries themselves don’t specify TENANTID in the WHERE clause. Instead, row-level security handles tenant filtering through
November 12, 2024 at 7:05 pm
Thank you, Scott, for the helpful advice! I’d like to dive a bit deeper into point (2) to better understand how partitioning impacts performance in a multi-tenant setup. I’m new...
November 12, 2024 at 6:24 pm
Here you are courtesy of ChatGPT:
Yes, it’s possible to run specific stored procedures (SP1 and SP2) in parallel and then have SP3 and SP4 execute in series within a main...
November 2, 2024 at 12:36 pm
I would use EXISTS instead of IN
update m
set val = 'TEST'
from #MDM m
where exists(SELECT 1
...
October 31, 2024 at 12:56 am
Try running the data transfer in multiple parallel sessions in SSMS, using chunked INSERT INTO ... SELECT queries. Open two or three SSMS windows, and in each, execute a separate...
October 26, 2024 at 11:13 pm
Jeff,
The "url" link to the excellent article at the beginning of this discussion isn't working. I believe it should point to https://www.sqlservercentral.com/articles/hidden-rbar-triangular-joins, but only you have the ability...
October 22, 2024 at 1:32 am
First and foremost, stop dropping and rebuilding indexes, I don't care how bad the fragmentation is. Even 90% logical fragmentation makes little difference. What DOES make a difference is...
September 30, 2024 at 11:08 pm
Viewing 15 posts - 16 through 30 (of 2,617 total)