|
|
Archives of the TeradataForum
Message Posted: Wed, 24 Nov 2004 @ 16:13:23 GMT
Subj: | | Missing qualifiers |
|
From: | | Hassinger, Bill |
Below is an example WHERE clause and the EXPLAIN. Although they are applied to the query results, why are most of the qualifiers not displayed
in the EXPLAIN? (I modified the explain to replace the table names with A and B, and removed the locking steps)
WHERE (A.CLAIMTYPE IN ('A','O','V','W','R','F','G','D')) AND
(A.FINALVERSIONIND='Y') AND (SDATE >= '01/01/2001' AND SDATE <=
'12/31/2003') AND ((A.INPUTMEDIATYPE='7') OR (A.INPUTMEDIATYPE NE '7'
AND B.LINEREIMBURSESTATUS NE 'D')) AND ( (PROCCPT
IN('90700','90701','90720','90721','90723','90702','90719',
'90703','90712','90713','90707','90710','90705','90708',
'90704','90709','90706','90645','90646','90647','90648',
'90748','90740','90744','90747','90748','90716','90698')) OR (PROCCPT
IN('90743','90731','90745','90746')) OR ((PROCCPT >='D0120' AND PROCCPT
<='D0999') OR (PROCCPT >='D1110' AND PROCCPT <='D1550') OR (PROCCPT
>='D2110' AND PROCCPT <='D2999') OR (PROCCPT >='D3110' AND PROCCPT
<='D3999') OR (PROCCPT >='D4210' AND PROCCPT <='D4999') OR (PROCCPT
>='D5110' AND PROCCPT <='D5899') OR (PROCCPT >='D6010' AND PROCCPT
<='D6199') OR (PROCCPT >='D7110' AND PROCCPT <='D7999') OR (PROCCPT
>='D8010' AND PROCCPT <='D8999') OR (PROCCPT >='D9110' AND PROCCPT
<='D9999')) OR (PROCCPT IN('70300','70310','70320','70350','70355'))
OR
(PROCCPT IN('82270','82274','45330','45331','45332','45333','45334',
'45335','45336','45337','45338','45339','45340','74270',
'74280','44388','44389','44390','44391','44392','44393',
'44394','45355','45378','45379','45380','45381','45382',
'45383','45384','45385','45387')) OR (PROCCPT
IN('76090','76091','76092')) OR (PROCCPT
IN('88141','88142','88143','88144','88145','88147','88148',
'88150','88152','88153','88154','88155','88164','88165',
'88166','88167','88174','88175')) OR (PROCCPT
IN('11975','11976','11977','57170','58300','58301','58600',
'58605','58611','59615','58970','58974','58976','59000',
'59001','59012','59015','59020','59025','59030','59050',
'59051','59100','59120','59121','59130','59135','59136',
'59140','59150','59151','59160','59200','59300','59320',
'59325','59350','59400','59409','59410','59412','59414',
'59425','59426','59430','59510','59514','59515','59525',
'59610','59612','59614','59618','59620','59622','59812',
'59820','59821','59830','59840','59841','59850','59851',
'59852','59855','59856','59857','59866','59870','59871',
'59898','59899','76801','76805','76810','76811','76812',
'76815','76816','76817','76818','76819','76825','76826',
'76827','76828','76830','76941','76945','76946','80055',
'81025','82105','82106','82731','83516','83518','83519',
'83520','84702','84703','86592','86593',
'86631','86632','87110','87164','87166','87270','87320',
'87490','87491','87492','87590','87591','87592','87620',
'87621','87622','87810','87850','88141','88142','88143',
'88144','88145','88147','88148','88150','88152','88153',
'88154','88155','88160','88161','88162','88164','88165',
'88166','88167','88174','88175','88235','88267','88269',
'59070','59072','59074','59076','59897','87800','87801')) OR (PROCCPT
IN('21800','21805','21810','21820','21825','22305','22310',
'22315','22318','22319','22325','22326','22327','22328',
'23500','23505','23515','23570','23575','23585','23600',
'23605','23615','23616','23620','23625','23630','23665',
'23670','23675','23680','24500','24505','24515','24516',
'24530','24535','24538','24545','24546','24560','24565',
'24566','24575','24576','24577','24579','24582','24586',
'24587','24620','24635','24650','24655','24665','24666',
'24670','24675','24685','25500','25505','25515','25520',
'25525','25526','25530','25535','25545','25560','25565',
'25574','25575','25600','25605','25611','25620','25622',
'25624','25628','25630','25635','25645','25650','25651',
'25652','25680','25685','26600','26605','26607','26608',
'26615','27193','27194','27200','27202','27215','27216',
'27217','27218','27220','27222','27226','27227','27228',
'27230','27232','27235','27236','27238','27240','27244',
'27245','27246','27248','27254','27500','27501','27502',
'27503','27506','27507','27508','27509','27510','27511',
'27513','27514','27520','27524','27530','27532','27535',
'27536','27538','27540','27750','27752','27756','27758',
'27759','27760','27762','27766','27780','27781','27784',
'27786','27788','27792','27808','27810','27814','27816',
'27818','27822','27823','27824','27825','27826','27827',
'27828','28400','28405','28406','28415','28420','28430',
'28435','28436','28445','28450','28455','28456','28465',
'28470','28475','28476','28485','76070','76071','76075',
'76076','76078','76499','76977','76999','78350','78351')) OR (PROCCPT
IN('92002','92003','92004','92005','92006','92007','92008',
'92009','92010','92011','92012','92013','92014','99201',
'99202','99203','99204','99205','99211',
'99212','99213','99214','99215','99217','99218','99219',
'99220','99241','99242','99243','99244','99245','99271',
'99272','99273','99274','99275','99289','99290','99301',
'99302','99303','99311','99312','99313','99321','99322',
'99323','99331','99332','99333','99341','99342','99343',
'99344','99345','99346','99347','99348','99349','99350',
'99351','99352','99353','99354','99355','99384','99385',
'99386','99387','99394','99395','99396','99397','99401',
'99402','99403','99404','99411','99412','99420','99429',
'99499','99221','99222','99223','99231','99232','99233',
'99238','99239','99251','99252','99253','99254','99255',
'99261','99262','99263','99281','99282','99283','99284',
'99285','99286','99287','99291','99292','99356', '99357')) OR (PROCCPT
'83036') OR (PROCCPT IN('80061','83715','83716','83721')) OR (PROCCPT
IN('67101','67105','67107','67108','67110','67112',
'67141','67145','67208','67210','67218','67227',
'67228','92002','92004','92012','92018','92019',
'92225','92226','92230','92235','92240','92250',
'92260','92287','99203','99204','99205','99213','99214','99215',
'99242','99243','99244','99245')) OR (PROCCPT
IN('82042','82043','82044','84160','84165','81050',
'36820','36821','50320','99512')) OR (PROCCPT
IN('99221','99222','99223','99231','99232','99233','99238',
'99239','99251','99252','99253','99254','99255','99261',
'99262','99263','99291','99292','99281','99282','99283',
'99284','99285','99201','99202','99203','99204',
'99205','99211','99212','99213','99214','99215','99217',
'99218','99219','99220','99241','99242','99243','99244',
'99245','99271','99272','99273','99274','99275','99356','99357')) OR
(PROCCPT IN('90801','90802','90804','90805','90806','90807','90808',
'90809','90810','90811','90812','90813','90814','90815','90816',
'90817','90818','90819','90821','90822','90823','90824','90826',
'90827','90828','90829','90845','90847','90849','90853','90857',
'90862','90870','90871','90875','90876','99201','99202','99203',
'99204','99205','99211','99212','99213','99214','99215','99241',
'99242','99243','99244','99245','99341','99342','99343','99344',
'99345','99347','99348','99349','99350','99383','99384','99385',
'99386','99387','99393','99394','99395','99396','99397','99401',
'99402','99403','99404')) OR (PROCCPT IN('99371','99372','99373')) OR
(PROCCPT IN('99201','99202','99203','99204','99205','99211','99212',
'99213','99214','99215','99241','99242','99243','99244','99245',
'99341','99342','99343','99344','99345','99347','99348','99349',
'99350','99301','99302','99303','99311','99312','99313','99321',
'99322','99323','99331','99332','99333','99385','99386','99387',
'99395','99396','99397','99401','99402','99403','99404','99411',
'99412','99420','99429','99499','92002','92004','92012','92014')) OR
(PROCCPT IN('99381','99382','99383','99384','99391','99392','99393',
'99394')) OR (PROCCPT
IN('59400','59409','59410','59510','59514','59515','59610',
'59612','59614','59618','59620','59622','59425','59426','76810','76811',
'76812','76815','76816','76817','76818','80055','86762',
'86900','86901','76801','76802','76805','76810')) OR (PROCCPT
IN('57170','58300','59400','59410','59430','59510','59515',
'59610','59614','59618','59622','88141','88142','88143',
'88144','88145','88147','88148','88150','88152','88153',
'88154','88155','88164','88165','88166','88167','88174',
'88175','86644','86694','86777')) OR (PROCCPT
IN('90801','90802','90804','90805','90806','90807','90808',
'90809','90810','90811','90812','90813','90814','90815',
'90826','90827','90828','90829','90845',
'90847','90849','90853','90857','90862','90870','90871',
'90875','90876','99201','99202','99203','99204','99205',
'99211','99212','99213','99214','99215','99217','99218',
'99219','99220','99241','99242','99243','99244','99245',
'99281','99282','99283','99284','99285','99341','99342',
'99343','99344','99345','99347','99348','99349','99350',
'99385','99386','99387',
'99395','99396','99397','99401','99402','99403','99404', '99420')) OR
(PROCCPT IN('99381','99382','99391','99392','99432')) OR (PROCCPT
IN('99382','99383','99392','99393')) OR (PROCCPT
IN('99384','99385','99394','99395')) OR ((PROCCPT
IN('99201','99202','99203','99204','99205','99211','99212',
'99213','99214','99215','99241','99242','99243','99244',
'99245','99341','99342','99343','99344','99345','99347',
'99348','99349','99350','99354','99355','99301','99302',
'99303','99311','99312','99313','99321','99322','99323',
'99331','99332','99333','99381','99382','99383','99384',
'99385','99386','99387','99391','99392','99393','99394',
'99395','99396','99397','99401','99402','99403','99404',
'99411','99412','99420','99429','99432','99499','92002',
'92004','92012','92014')) OR (((PROCCPT >= '10040' AND PROCCPT <=
'69979') OR (PROCCPT >= '99281' AND PROCCPT <= '99285')) AND (POS =
'23')) OR ((PROCCPT IN('92953','92970','92971','92975',
'92980','92982','92986','92990','92992','92993','92995',
'92996','93501','93503','93505','93508','93510','93511',
'93514','93524','93526','93527','93528','93529','93530',
'93531','93532','93533','93536','93600','93602','93603',
'93607','93609','93610','93612','93613','93615','93616',
'93618','93619','93620','93621','93622','93623','93624',
'93631','93640','93641','93642','93650','93651','93652')) AND (POS
IN('22','24'))) OR (PROCCPT IN('99217','99218','99219','99220')) ) OR
((PROCCPT IN('99201','99202','99203','99204','99205','99211','99212',
'99213','99214','99215','99217','99218','99219','99220',
'99241','99242','99243','99244','99245','99281','99282',
'99283','99284','99285','99341','99342','99343','99344',
'99345','99347','99348','99349','99350','99381','99382',
'99383','99384','99385','99386','99387','99391','99392',
'99393','99394','99395','99396','99397','99401','99402',
'99403','99404','99420')) AND (TP_TYPE
IN('10','17','41','42','46','68')) ) OR ((PROCCPT >= '90500' AND PROCCPT
<= '90580') OR (PROCCPT IN('99062','99063','99064','99065')) OR (PROCCPT
IN('99221','99222','99223','99231','99232','99233','99234',
'99235','99236','99238','99239','99251','99252','99253',
'99254','99255','99261','99262','99263','99271','99272',
'99273','99274','99275','99288','99291','99292','99417',
'99418','99419')) ) ) AND
(A.TRANSACTIONCONTROLNUMBER=B.TRANSACTIONCONTROLNUMBER)
The EXPLAIN:
Explanation -------------------------------------------------- | |
| 4) | We do an all-AMPs JOIN step from A by way of a RowHash match scan with a condition of ( "((A..InputMediaType <> '7') OR (A..InputMediaType
= '7')) AND ((A..FinalVersionInd = 'Y') AND ((A..ClaimType = 'A') OR ((A.ClaimType = 'O') OR ((A..ClaimType = 'V') OR ((A..ClaimType = 'W') OR
((A..ClaimType = 'R') OR ((A..ClaimType = 'F') OR ((A..ClaimType = 'G') OR (A..ClaimType = 'D')))"), which is joined to B. B and A are joined
using a merge join, with a join condition of ("((A.InputMediaType = '7') OR (B.LineReimburseStatus <> 'D')) AND (A.TransactionControlNumber =
B.TransactionControlNumber)"). The input tables A and B will not be cached in memory, but A is eligible for synchronized scanning. The result
goes into Spool 1, which is built locally on the AMPs. The result spool file will not be cached in memory. The size of Spool 1 is estimated with
low confidence to be 94,936,755 rows. The estimated time for this step is 1 hour and 41 minutes.
| |
| 5) | 5) Finally, we send out an END TRANSACTION step to all AMPs involved in processing the request.
| |
| -> | The contents of Spool 1 are sent back to the user as the result of statement 1. The total estimated time is 1 hour and 41 minutes.
| |
Bill H
Bill Hassinger, DWA
ITS / Data Warehouse
| |