Quantcast
Channel: Teradata Forums - Database
Viewing all 14773 articles
Browse latest View live

SQL Syntax - response (1) by ulrich

$
0
0

did you try to create a view like

Create view VW2 as 
SEL a.col1, 
    a.col2, 
    a.col3, 
    b.col4 
from 
( sel col1, 
      col2, 
      col3 
   from tab1 
   where col2 = 'ABC'
) a
left outer join
(SEL col1, 
     Col3 as col4 
 from tab1 
 where col2 = 'ABC'
 qualify row_number() over ( order by col1) = 1
) b 
on a.col1 = b.col1;

If yes, what had been the issue?
If no, what had been preventing you from doing so?


What is compress? With example pls explain?What is use of compress? - forum topic by sai_666

$
0
0

What is compress? With example pls explain?What is use of compress?

Forums: 

What is compress? With example pls explain?What is use of compress? - response (1) by KS42982

SQL Syntax - response (2) by AsherShah

$
0
0

yes, I tired but it won't work because this view can not have the hard coded WHERE clause as this will be passed by user. Based on your syntax view should be like code below but this is not working for my requirement. The left outer join part is returing result from whole table while first sel is returning correct result. Both sides of join are not matching in the view sql like the way they do in query.
 
CreateviewVW2 as

SEL a.col1,

a.col2,

a.col3,

b.col4

from

( sel col1,

col2,

col3

fromtab1

) a

leftouterjoin

(SEL col1,

Col3 ascol4

fromtab1

qualify row_number() over ( orderbycol1) = 1

) b

ona.col1 = b.col1;

 

 

Algorithmic compression in DBQL History tables - forum topic by TSchmolzi

$
0
0

I am considering the impementation of algorithmic compression within our 13.10 system's DBQL History tables. We have quite a long retention requirement for this data and the daily maintenance and nightly backups are starting to become an issue because of the large sizes. I have used the Atanasoft CompressTool to identify canidates for muti-value compression and recently implemented the recommendations. This has helped significantly, especially for the DBQLogTbl, but long strings such as the query text, queryband and logon strings are untouched. I thought these particular columns would possibly benefit from AC. I have read the documentation on compression but am still concerned about performance during the nightly historical processes and retrieval.
Has anyone else condidered or implemented algorithmic compression within these historical tables. Any other suggestions that may be beneficial.
Does anyone else have extended retation requirements for their historical DBQL data and approaches the problem from a different angle?

Forums: 

SQL Syntax - response (3) by dnoeth

$
0
0

You probably need to a PARTITION to your ROW_NUMBER:
row_number() over (PARTITION BY col2 order by col1)
 
But you should check explain, it might do the STATS step before applying the WHERE filter.
Dieter

Performance considerations during taking back up-- - response (5) by Nishant.Bhardwaj

$
0
0

Thanks Dieter for the Response..
Actaully the thing is ,we have PPI defined on A so when we do the  INSERT SELECT on the empty A_bkp table then in this case  optimizer is using the spool space and hence taking lot of time and leading to spool space issues.
I think INSERT SELECT on a NONPPI table doesnt use any spool.
Hence we thought of doing it with MERGE statement which is not throwing any ERROR.. i think  it doesnt uses any spool and does BLOCK by BLOCK ..thats why.. pls confirm..
Just  wanted to know out of curiousity  the possible other scenerios in which  MERGE  STATEMENT is Preferred.?
 
Thanks !
 
Regards,
Nishant
 
 

Performance considerations during taking back up-- - response (6) by dnoeth

$
0
0

Hi Nishant,
if target is an exact copy of source then there will be no spool involved, regardless of PPI or not, simply look at explain.
You should check if A and A_bkp DDL is different.
Dieter
 


Performance considerations during taking back up-- - response (7) by Nishant.Bhardwaj

$
0
0

Hi Dieter ,
Both are having same Structures but they are created at different databases, i mean, one at LIVE and other at BACKUP Db.
does different DB's making the usage of spool in INSERT Select?
 
Also can you please  suggest the scenrios which MERGE gives the OPTIMAL performance?
 
THanks!
Nishant

Performance considerations during taking back up-- - response (8) by dnoeth

$
0
0

Hi Nishant,
same database or not doesn't matter. If there's spool usage there must be a difference in DDL.
MERGE might use no spool when both source and target have the same (P)PI.
Dieter

SQL Syntax - response (4) by ulrich

$
0
0

It's like Dieter suggested
try 

replace view test_db _uli.v_test1
as
select a.col1,
       a.col2,
       a.col3,
       b.col4
from
(
select calendar_date as col1, 
       month_of_year as col2, 
       year_of_calendar as col3
from sys_calendar.calendar
) a
left join 
(
select calendar_date as col1, 
       year_of_calendar as col4
from sys_calendar.calendar
qualify row_number() over (partition by month_of_calendar order by calendar_date) = 1
) b
on a.col1 = b.col1
;

select * from test_db _uli.v_test1 
where col2 = 3 and col3 in ( 2012, 2013)
order by 1

 

Performance considerations during taking back up-- - response (9) by Nishant.Bhardwaj

Compression in Teradata - response (1) by KS42982

$
0
0

When you do INSERT-SELECT between 2 exact same tables then there is NO spool involved at all. That might be the reason when you match the datatype in table2 with table1, you do not get the spool space error.
Regarding getting the spool space error, there must be bad PI and/or PPI in these tables. Check the data in table once and make sure data is getting distributed evenly (as much as possible) among the amps. Also, if you are using your own id then either you can ask DBA to provide more spool space to your id or you can use some ETL id to do that operation as ETL ids usually have enough spool space allocated to them to perform such operations.

Metadata information for a view - forum topic by sam_dhse

$
0
0

If i query dbc.columns for a particular table within a database it gives me column data type with its length.However if i have a custom view that is build on top of lets suppose 2 tables and if i query dbc.columns for this view it won't give me the column datatypes or length of columns in the view.
Any suggestion on how can i get column datatype and length of the columns in this custom view.

Forums: 

What is compress? With example pls explain?What is use of compress? - response (2) by sai_666


Data movement across Terdata server - forum topic by meet_as

$
0
0

Hi Experts,
Please offer your opinion on data movement  across Teradata servers( for e.g. production to Test, TD 14 to TD 12/13 or vice versa) using TTU. If you have to rank the tool/technology from the following in terms of performance and Price how would you  -
1> Archive/Restore through ARCMain
2> TPT
3> FAST export/Fast load
 
Regards,
Meet_As
 

Forums: 

how know the difference between compress table and general table ? - forum topic by sai_666

$
0
0

how know the difference between compress table and general table ?

Forums: 

how know the table size ? - forum topic by sai_666

Update statement using self join - forum topic by arbiswas

$
0
0

Hi Experts,
I hava an employee table which effective date and post effective date. post_eff_dt is next eff_dt for that employee.
So if 31-jan-2013 is first row and 28-feb-2013 is second row then row should look like this
EMP    EFFDT          POST_EFFDT
27227    31-jan-2013  28-feb-2013
27227    28-feb-2013  2999-12-31 (High date for latest record)
Now if same effdt has multiple rows, then I am facing problem.
My data is looking like (set A)
27227  1/3/2012   1/3/2012
27227  1/3/2012   31/12/2999
27227 1/10/2011  1/10/2011
27227 1/10/2011  1/3/2012
27227 1/1/2007    1/10/2011
27227 1/1/2007    1/1/2007
27227 21/09/2006 1/1/2007
27227 21/09/2006 21/09/2006
and it should be, (SET B)
27227 1/3/2012     31/12/2999
27227 1/3/2012     31/12/2999
27227 1/10/2011    1/3/2012
27227 1/10/2011    1/3/2012
27227 1/1/2007     1/10/2011
27227 1/1/2007     1/10/2011
27227 21/09/2006  1/1/2007
27227 21/09/2006  1/1/2007
Can you pls provide the update statement to get SET B from SET A.
 
Thanks in advance,

Forums: 

how know the table size ? - response (2) by mohan.mscss

$
0
0

sel * from dbc.tablesize where tablename='employee' and databasename='xxxx'

Viewing all 14773 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>