Hello All!
Is there a better way to do criteria?
This is what I have and it takes a good minute or two.
It runs in maybe 2 seconds if I took out the Self-join. I tried to make it a WHERE NOT EXISTS but it was just as slow.
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008
Is there a better way to do criteria?
This is what I have and it takes a good minute or two.
Code:
SELECT [TS_USER_11] 'Product Owner'
,[TS_USER_10] as 'Product Area'
,[TS_TEST_ID] as 'Test ID'
,[TS_NAME] as 'Test Name'
,[TS_STATUS] as 'Status'
,[TS_RESPONSIBLE] as 'Creator'
,[TS_CREATION_DATE] 'Date Created'
,[TS_TYPE] 'Type'
FROM TEST WITH (NOLOCK), ALL_LISTS WITH (NOLOCK)
WHERE TEST.TS_SUBJECT = ALL_LISTS.AL_ITEM_ID
AND (TEST.TS_TYPE = 'MANUAL' OR TEST.TS_TYPE = 'QUICKTEST_TEST')
AND ALL_LISTS.AL_ABSOLUTE_PATH Not Like 'AAAAAJAAD%'--Archived
AND ALL_LISTS.AL_ABSOLUTE_PATH Not Like 'AAAAAJABL%'--QA Services
AND ALL_LISTS.AL_ABSOLUTE_PATH Not Like 'AAAAAJACB%'--Recycle Bin
AND (TS_USER_10 = 'ASG' AND TS_USER_11 <> 'Leslie Burnett')
OR (TS_USER_10 = 'ATBS' AND TS_USER_11 <> 'Beth Hubner')
OR (TS_USER_10 = 'AUI' AND TS_USER_11 <> 'Jacky Rasaphoumy')
OR (TS_USER_10 = 'AUI-EU' AND TS_USER_11 <> 'Deepa Kalangi')
OR (TS_USER_10 = 'BB' AND TS_USER_11 <> 'Santaji Nanaware')
OR (TS_USER_10 = 'BOFA' AND TS_USER_11 <> 'Azza Shehata')
OR (TS_USER_10 = 'BPM' AND TS_USER_11 <> 'Joseph Brooks')
OR (TS_USER_10 = 'CRM-BILL' AND TS_USER_11 <> 'Mandeep Uppal')
OR (TS_USER_10 = 'CRM-CL' AND TS_USER_11 <> 'Beth Hubner')
OR (TS_USER_10 = 'CRM-COP' AND TS_USER_11 <> 'Nick Thorne')
OR (TS_USER_10 = 'CRM-CSAT' AND TS_USER_11 <> 'Nick Thorne')
OR (TS_USER_10 = 'CRM-EU' AND TS_USER_11 <> 'Beth Hubner')
OR (TS_USER_10 = 'CRM-HS' AND TS_USER_11 <> 'Nick Thorne')
OR (TS_USER_10 = 'CRM-MTS' AND TS_USER_11 <> 'Mandeep Uppal')
OR (TS_USER_10 = 'CRM-SCR' AND TS_USER_11 <> 'Jacky Rasaphoumy')
OR (TS_USER_10 = 'CSET' AND TS_USER_11 <> 'Shelly McCormack')
OR (TS_USER_10 = 'CS-NET' AND TS_USER_11 <> 'Ryan Oglesby')
OR (TS_USER_10 = 'CS-TIBCO' AND TS_USER_11 <> 'Ryan Oglesby')
OR (TS_USER_10 = 'DAX' AND TS_USER_11 <> 'Azza Shehata')
OR (TS_USER_10 = 'DAX-EU' AND TS_USER_11 <> 'Deepa Kalangi')
OR (TS_USER_10 = 'EC' AND TS_USER_11 <> 'Shelly McCormack')
OR (TS_USER_10 = 'EP' AND TS_USER_11 <> 'Fatema Pedhiwala')
OR (TS_USER_10 = 'ETL' AND TS_USER_11 <> 'Nick Thorne')
OR (TS_USER_10 = 'IG' AND TS_USER_11 <> 'Nick Thorne')
OR (TS_USER_10 = 'INF' AND TS_USER_11 <> 'Brad Wirths')
OR (TS_USER_10 = 'INTST' AND TS_USER_11 <> 'Swapnil Patil')
OR (TS_USER_10 = 'IR' AND TS_USER_11 <> 'Mandeep Uppal')
OR (TS_USER_10 = 'IS' AND TS_USER_11 <> 'Nick Thorne')
OR (TS_USER_10 = 'IVR' AND TS_USER_11 <> 'Kimberly Cooper')
OR (TS_USER_10 = 'LI' AND TS_USER_11 <> 'Fatema Pedhiwala')
OR (TS_USER_10 = 'LOG' AND TS_USER_11 <> 'Ryan Oglesby')
OR (TS_USER_10 = 'LR' AND TS_USER_11 <> 'Mandeep Uppal')
OR (TS_USER_10 = 'MEA' AND TS_USER_11 <> 'Mandeep Uppal')
OR (TS_USER_10 = 'MRAA' AND TS_USER_11 <> 'Mandeep Uppal')
OR (TS_USER_10 = 'PS' AND TS_USER_11 <> 'Nick Thorne')
OR (TS_USER_10 = 'PT' AND TS_USER_11 <> 'Shelly McCormack')
OR (TS_USER_10 = 'QAS' AND TS_USER_11 <> 'Brandon Ainsworth')
OR (TS_USER_10 = 'QAS' AND TS_USER_11 <> 'Shelly McCormack')
OR (TS_USER_10 = 'RA' AND TS_USER_11 <> 'Azza Shehata')
OR (TS_USER_10 = 'SD' AND TS_USER_11 <> 'Brandon Ainsworth')
OR (TS_USER_10 = 'STAR' AND TS_USER_11 <> 'Azza Shehata')
OR (TS_USER_10 = 'VTI' AND TS_USER_11 <> 'Swapnil Patil')
OR (TS_USER_10 = 'W7' AND TS_USER_11 <> 'Jason Little')
OR (TS_USER_10 = 'WATS-BS' AND TS_USER_11 <> 'Leslie Burnett')
OR (TS_USER_10 = 'WISE' AND TS_USER_11 <> 'Leslie Burnett')
OR (TS_USER_10 = 'WITS-ATT' AND TS_USER_11 <> 'Leslie Burnett')
OR (TS_USER_10 = 'WITS-CENT' AND TS_USER_11 <> 'Leslie Burnett')
OR (TS_USER_10 = 'WITS-SPR' AND TS_USER_11 <> 'Leslie Burnett')
OR (TS_USER_10 = 'WUI' AND TS_USER_11 <> 'Shelly McCormack')
OR (TS_USER_10 = 'WUI-ATT' AND TS_USER_11 <> 'Shelly McCormack')
OR (TS_USER_10 = 'WUI-EU' AND TS_USER_11 <> 'Deepa Kalangi')
ORDER BY [TS_USER_11]
It runs in maybe 2 seconds if I took out the Self-join. I tried to make it a WHERE NOT EXISTS but it was just as slow.
- Matt
"If I must boast, I will boast of the things that show my weakness"
- Windows 2003 Server, 98 SE, XP
- VB.NET, VSTS 2010, ASP.NET, EXCEL VBA, ACCESS, SQL 2008