Viewing 15 posts - 46 through 60 (of 2,648 total)
Does partitioning by TENANTID improve query performance when most queries are filtered by tenant? For instance, will partitioning reduce the amount of data SQL Server scans, or is...
November 20, 2024 at 1:58 am
Nice.
Also, you don't have to change the FKs in other tables if you need one for just ID. Instead, just add a unqiue nonclus index on ( ID );...
November 20, 2024 at 12:01 am
I've created a stored procedure that takes a table name as a parameter and checks the clustered index column order. If the order is ID, TENANTID, the procedure drops the...
November 19, 2024 at 11:49 pm
Currently deleting using by day
WHERE SpoolStartDt = '2022-09-30 00:00:00.000';
How could I delete a MONTH at a time..
Thanks.
Using YEAR and MONTH Functions:
INSERT INTO #ToDelete (Id)
SELECT Id
...
November 17, 2024 at 9:54 pm
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
Viewing 15 posts - 46 through 60 (of 2,648 total)