Viewing 15 posts - 631 through 645 (of 747 total)
You could make the parameter that window/time range.
Obviously your underlying will have to change.
If it's always 30 days windows like your two examples suggest (is that sample really representative, or...
July 29, 2021 at 2:52 pm
So you're saying it's a good thing there isn't a BacklogUpdateTrackingTable?
🙂
July 15, 2021 at 3:58 pm
Indexed views can't reference other databases - Tables must be referenced by two-part names, schema.tablename in the view definition.
Indexed views cannot contain common table expressions.
https://www.brentozar.com/archive/2013/11/what-you-can-and-cant-do-with-indexed-views/
A couple of possible alternatives:
July 12, 2021 at 2:46 pm
You have no explicit column(s) by which the data can be you reliably ordered and grouped. You have no ID, date, or other criteria for ordering or grouping the data.
Your sample...
July 8, 2021 at 2:47 pm
Does csi_sample_specs have an index on csi_sample_id and spec_size (ideally including spec_amount if a nonclustered index)?
How slow is super slow? What is expected/needed execution time? Do other queries execute quickly?
What...
July 2, 2021 at 6:02 pm
https://www.microsoft.com/en-us/download/details.aspx?id=57474 is just the Service Pack 3 installer.
https://www.microsoft.com/en-us/download/details.aspx?id=57473 has downloads for SQL Express and other components with SP3 integrated.
You probably just need the service pack (57474).
July 2, 2021 at 1:24 pm
You're often better off using a UNION ALL to separate the cases into statements with their own sargeable where clauses -- e.g.,
SELECT ...
FROM ...
WHERE @Test = 'Yes'...
June 28, 2021 at 9:08 pm
where len(r.portionkey)=len(m.portionkey)
The functions are going to prevent SQL Server from using indexes effectively even if you had them. It also seems to indicate that portion...
June 14, 2021 at 7:20 pm
You have no primary keys or indexes. SQL Server has to scan the table for every query/subquery/CTE.
Your datatypes seem questionable.
June 14, 2021 at 1:35 pm
What queries use those indexes? Do they (always) use the same columns as predicates (where clauses, joins, order bys)?
Any queries that use the index must use the first index key...
June 9, 2021 at 8:56 pm
Unfortunately, you missed the requirement that the source and target tables must have identical indexes.
May 24, 2021 at 9:05 pm
A case statement should do it:
-- Change operators appropriately if not inclusive
CASE WHEN Amount >= Column1 AND Amount <=...
May 14, 2021 at 1:20 pm
Assuming you have a CreatedDateTime or equivalent that is always populated (e.g., has a default value & nobody explicitly sets it to null), yes, it seems possible.
You'd probably use a...
May 3, 2021 at 1:32 pm
Based on To cool datacenter servers, Microsoft turns to boiling liquid => 3M Immersion cooling for data centers, it sounds like it's one of these: Fluorinert™ Electronic Liquids
April 28, 2021 at 3:34 pm
It's extremely difficult to get even mostly right, and tends to be a trial and error process of discovering and fixing the logic for those that were mishandled... without breaking...
April 23, 2021 at 1:20 pm
Viewing 15 posts - 631 through 645 (of 747 total)