Viewing 15 posts - 16 through 30 (of 31 total)
ChrisM@Work (5/25/2016)
jc85 (5/25/2016)
How should i post the table with data on this forum?How many rows do you need for ann_events_Tech_Details table?
ChrisM@Work (5/25/2016)
May 25, 2016 at 12:05 pm
ChrisM@Work (5/25/2016)
jc85 (5/25/2016)
ChrisM@Work (5/25/2016)
Sorry my bad, missed the correlation:
SELECT
[date] = CAST(b.start_time AS DATE),
[report_item] = (b.[source] + '-' + 'a.report_item'),
[EN] = SUM(CASE WHEN b.lang = 'EN' THEN 1 ELSE...
May 25, 2016 at 9:21 am
ChrisM@Work (5/25/2016)
Sorry my bad, missed the correlation:
SELECT
[date] = CAST(b.start_time AS DATE),
[report_item] = (b.[source] + '-' + 'a.report_item'),
[EN] = SUM(CASE WHEN b.lang = 'EN' THEN 1 ELSE 0 END),...
May 25, 2016 at 9:08 am
ChrisM@Work (5/25/2016)
jc85 (5/25/2016)
ChrisM@Work (5/25/2016)
Only one clustered index per table, but the index can contain more than one column."Different result" is too vague, please explain.
Thanks, added.
Incorrect result is returned, it is...
May 25, 2016 at 4:28 am
ChrisM@Work (5/25/2016)
Only one clustered index per table, but the index can contain more than one column."Different result" is too vague, please explain.
Thanks, added.
Incorrect result is returned, it is not the...
May 25, 2016 at 4:10 am
Isn't 1 clustered index is allowed per table?
The query returned different result.
May 25, 2016 at 3:52 am
How should i post the table with data on this forum?
How many rows do you need for ann_events_Tech_Details table?
May 25, 2016 at 3:41 am
Thanks ChrisM@Work.
The query took quite some time to complete.
Additional info provided in case you need it.
ann_events_Tech_Details
[start_time] - clustered index
[id] - Unique, non-clustered index (PK)
ann_ReportItem
[source] - non-clustered index
[call_flow_name] - non-clustered...
May 25, 2016 at 3:00 am
Try CAST(b.start_time AS DATE)
instead of dateadd (dd, 0, datediff(dd , 0, b.start_time ))
Just tried it, took longer time to complete.
May 25, 2016 at 2:16 am
Sergiy (5/24/2016)
Make both PK's non-clustered and create a new clustered index on [start_time].
That's what you've got:
WHERE (dateadd(dd,0, datediff(dd,0,b.start_time))) >= @StartDate
AND (dateadd(dd,0, datediff(dd,0,b.start_time))) <= @EndDate
I assume...
May 25, 2016 at 1:36 am
Sergiy (5/24/2016)
jc85 (5/24/2016)
Added start_time as Non-clustered index for table ann_events_Tech_Details.Make it clustered.
Otherwise - drop it, no use of it anyway.
Both tables already have id set as their clustered index so...
May 24, 2016 at 9:17 pm
GilaMonster (5/24/2016)
Start with an index on each table, columns used in the where clause first in the index key, then columns used in the group by
Hope I understood correctly.
Added start_time...
May 24, 2016 at 12:11 pm
Yes, both tables do not have non clustered index.
Will attach the actual plan what's I have access to my pc.
May 24, 2016 at 6:17 am
Thanks for the feedback everyone!
The tables structure I provided earlier was a simplified version as I believed it will be sufficient, turned out I was wrong. Full table structure as...
May 24, 2016 at 4:14 am
Viewing 15 posts - 16 through 30 (of 31 total)