July 14, 2014 at 4:07 pm
This is what puzzled me and I can't stop scratching my head and I am wondering if someone can look at this for me? I am also attaching the execution plan. The problem is that when I look at the plan, it shows me that the table T349 is accesses as well and I don't see why it was used in this query?
SELECT TOP 51 T659.C1,C875000002,C875096001,C875055003,C875055012,C875055002,C875055004,C3,C875000004,C6,C875055026,C875055010,C875055011,C875055000,C875000000,C875055005,C875055001,C775055005,C775055000,C775055123,C812000101,C875052022,C875056001,C875061025,C875138004 FROM T659 WHERE (((T659.C875055024 = N'AA1.AH38.AH206') OR (T659.C875055024 = N'AA1.AH38.AH206')) AND (T659.C875055011 IS NULL) AND (T659.C875055012 != N'Cancelled') AND ((T659.C2 = N'SAEATON') OR (T659.C112 LIKE N'%;''SAEATON'';%') OR (T659.C112 LIKE N'%;0;%') OR (T659.C112 LIKE N'%;71205;%') OR (T659.C112 LIKE N'%;71025;%') OR (T659.C112 LIKE N'%;71015;%') OR (T659.C112 LIKE N'%;70995;%') OR (T659.C112 LIKE N'%;70405;%') OR (T659.C112 LIKE N'%;70055;%') OR (T659.C112 LIKE N'%;70015;%') OR (T659.C112 LIKE N'%;70004;%') OR (T659.C112 LIKE N'%;70003;%'))) ORDER BY C875055011 ASC,C875000002 DESC, 1 ASC
"He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]
July 15, 2014 at 1:42 am
What type of object is T659? Is it a view or a table, as that object isn't in the plan which leads me to think its a view which joins together T349 and T354.
July 15, 2014 at 8:56 am
anthony.green (7/15/2014)
What type of object is T659? Is it a view or a table, as that object isn't in the plan which leads me to think its a view which joins together T349 and T354.
It is a table.
"He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]
July 15, 2014 at 9:01 am
Strange that is not referenced in the query plan then as there is no mention of T659.
Can you post the output of the below when running it inside the databases context.
SELECT type_desc FROM sys.objects WHERE name = 'T659'
July 15, 2014 at 9:08 am
Can you post the output of the below when running it inside the databases context.
SELECT type_desc FROM sys.objects WHERE name = 'T659'
I feel like an idiot now. I should have checked before. It is a VIEW and not a table.:Wow:
"He who learns for the sake of haughtiness, dies ignorant. He who learns only to talk, rather than to act, dies a hyprocite. He who learns for the mere sake of debating, dies irreligious. He who learns only to accumulate wealth, dies an atheist. And he who learns for the sake of action, dies a mystic."[/i]
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply