I am running a query similar to given below.
CREATE TABLE ABC_08
AS
(SELECT x.col1,
trim(x.col2),
x.col3,
x.col4,
x.col5
FROM Table1 x
LEFT OUTER JOIN
Table2 c
on x.col1 = c.col1
WHERE (col4 NOT LIKE '%DC'
AND x.col3 in (SELECT col3 FROM Table3)
AND trim(x.col2) in (SELECT col2 from Table4)
AND x.col5 NOT IN (SELECT col5 FROM Table5) ))
WITH DATA;
This query is taking lots of time whereas when I try to select only,it is giving immediate result.
SELECT x.col1,
trim(x.col2),
x.col3,
x.col4,
x.col5
FROM Table1 x
LEFT OUTER JOIN
Table2 c
on x.col1 = c.col1
WHERE (col4 NOT LIKE '%DC'
AND x.col3 in (SELECT col3 FROM Table3)
AND trim(x.col2) in (SELECT col2 from Table4)
AND x.col5 NOT IN (SELECT col5 FROM Table5)
I am converting oracle script to teradata. The oracle equivalent for the above one is not taking much time to create table. It does not contain a primary index in oracle so I didnt provide the same in teradata. Table1 contains about 190000 records. Please help me
Thanks
resmi318
CREATE TABLE ABC_08
AS
(SELECT x.col1,
trim(x.col2),
x.col3,
x.col4,
x.col5
FROM Table1 x
LEFT OUTER JOIN
Table2 c
on x.col1 = c.col1
WHERE (col4 NOT LIKE '%DC'
AND x.col3 in (SELECT col3 FROM Table3)
AND trim(x.col2) in (SELECT col2 from Table4)
AND x.col5 NOT IN (SELECT col5 FROM Table5) ))
WITH DATA;
This query is taking lots of time whereas when I try to select only,it is giving immediate result.
SELECT x.col1,
trim(x.col2),
x.col3,
x.col4,
x.col5
FROM Table1 x
LEFT OUTER JOIN
Table2 c
on x.col1 = c.col1
WHERE (col4 NOT LIKE '%DC'
AND x.col3 in (SELECT col3 FROM Table3)
AND trim(x.col2) in (SELECT col2 from Table4)
AND x.col5 NOT IN (SELECT col5 FROM Table5)
I am converting oracle script to teradata. The oracle equivalent for the above one is not taking much time to create table. It does not contain a primary index in oracle so I didnt provide the same in teradata. Table1 contains about 190000 records. Please help me
Thanks
resmi318
Comment