By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 844 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

Query in teradata taking long time

P: 29
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
Feb 14 '08 #1
Share this Question
Share on Google+
4 Replies


amitpatel66
Expert 100+
P: 2,367
Try this:

Create a GLOBAL TEMPORARY TABLE in oracle and insert the data of your select query in to the GTT. Once done, use GTT in teradata to create a table there. Post back in case of any issues!!
Feb 15 '08 #2

P: 29
Try this:

Create a GLOBAL TEMPORARY TABLE in oracle and insert the data of your select query in to the GTT. Once done, use GTT in teradata to create a table there. Post back in case of any issues!!
Thanks for your reply. But I am using two different machines. Terdata and Oracle servers are different. I am ftping the oracle scripts to teradata machine and converting the same

Thanks
Resmi318
Feb 18 '08 #3

amitpatel66
Expert 100+
P: 2,367
Thanks for your reply. But I am using two different machines. Terdata and Oracle servers are different. I am ftping the oracle scripts to teradata machine and converting the same

Thanks
Resmi318

I understand that they are two different machine. Noe please clarify are you looking for transfering the data from teradata to oracle database and how you are doing that??
Feb 18 '08 #4

P: 29
I understand that they are two different machine. Noe please clarify are you looking for transfering the data from teradata to oracle database and how you are doing that??
I needed some tables in Oracle which I exported as flatfile and created in teradata. I dont have any issue here.
Now the problem is in running queries on the teradata machine.It is taking long time create table and even update statements.

Thanks
Resmi318
Feb 20 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.