Viewing 15 posts - 3,316 through 3,330 (of 7,614 total)
select top 2 *
from (
select max(u.iduser) iduser, max(u.score)...
June 20, 2018 at 9:31 am
As with any nonclus index, SQL estimating that too many pages will be needed from the nonclus index causes SQL to drop back to just scanning the main table. I...
June 20, 2018 at 9:29 am
June 19, 2018 at 3:12 pm
For the CCI, SQL will effectively have to scan all the rows for every query. If you can a nonclus index, SQL may be able to just do lookups to...
June 19, 2018 at 1:05 pm
Agree with Luis, except even more strongly:
We must see the DDL for the tables, including all indexes.
It would also be nice to see usage stats for those indexes,...
June 19, 2018 at 1:00 pm
Also, consider clustering dbo.MyTable on (ValidUntil, CreatedOn) or adding ValidUntil to the nonclus index. [You don't have to cluster tables by identity, and it can actually be quite harmful to...
June 19, 2018 at 12:45 pm
If you (almost) always join on all the keys, then yes, cluster on all of them.
You really should strongly consider defining the clus index before loading the table...
June 19, 2018 at 9:18 am
Given that a matched pickup and dropoff won't change in the future, when a dropoff gets entered, have a trigger link it to its pickup (store the pickup key(s) in...
June 18, 2018 at 12:00 pm
I'd check column separately rather than adding them, just in case negative amounts could appear now, or somehow do appear later:
WHERE CE.CLOSING_CREDITS <> 0 AND CE.CLOSING_DEBITS <> 0
June 15, 2018 at 4:14 pm
Also, you want to avoid BETWEEN when dealing with dates / times.
I have heard this often but I have never seen any proof as to why. I am...
June 15, 2018 at 12:55 pm
SELECT TOP (2) IDUser, Score, Name
FROM (
SELECT U.IDUser, U.Score, U.RecordDt, S2.Name,
ROW_NUMBER() OVER(PARTITION BY U.IDUser, S2.Name ORDER BY U.RecordDt DESC) AS...
June 14, 2018 at 12:20 pm
I think something like below is much easier to follow. Also, you want to avoid BETWEEN when dealing with dates / times.
I can't tell for sure if the...
June 14, 2018 at 11:53 am
Or, better yet, just go back to properly using 1NF in the table and store all values as atomic, i.e., individual columns. The computed column should be the concatenated value,...
June 12, 2018 at 1:06 pm
Viewing 15 posts - 3,316 through 3,330 (of 7,614 total)