Viewing 15 posts - 3,166 through 3,180 (of 7,614 total)
MERGE is notorious for some performance issues. You might want to try "UPSERT" -- an equivalent UPDATE followed by an INSERT.
For overall performance,, make sure you have...
September 17, 2018 at 3:41 pm
100% not using a JOIN clause screams "noob".
But I see many more issues.
A serious one is not including a schema name before the table names. ...
September 17, 2018 at 3:24 pm
September 17, 2018 at 3:02 pm
September 17, 2018 at 2:56 pm
September 17, 2018 at 12:36 pm
Remove the comma from the last column name before the FROM:
...
hd--, --<--remove this comma
...
from icr_emp
September 12, 2018 at 2:59 pm
You do need a separate codes table to do what you want. But that table could be fully maintained automatically by triggers on the "master table". That is, you wouldn't...
September 12, 2018 at 10:15 am
My preference has been to store the original sys.indexes and sys.index_columns rows rather than storing what you generated from them. You can always generate it later if you need to,...
September 11, 2018 at 4:28 pm
Not 100% sure of the specific MIN rules, but something like this should do it, and far more efficiently:
SELECT DISTINCT
ire.SourceId as...
September 7, 2018 at 10:49 am
Long shot, but I suppose it's possible that the original db was very physically fragmented on disk and the restore made the disk contiguous. Very rare nowadays, esp. with modern...
September 7, 2018 at 9:01 am
Look into log space allocations. You can trace them in different ways, including extended events.
When a log file is extended, activities in the db must cease while...
September 6, 2018 at 10:17 am
How is the table clustered? If you query the table by date, cluster it by date. Then you won't have any issues reading historical data, and you could safely use...
September 6, 2018 at 9:12 am
It really does seem to be some efficiency mechanism in SQL to not use more...
September 6, 2018 at 7:49 am
It really does seem to be some efficiency mechanism in SQL to not use more than 5 bytes unless it's actually needed to store the specific value being saved.
September 5, 2018 at 3:04 pm
Viewing 15 posts - 3,166 through 3,180 (of 7,614 total)