Tperf calculation for my system - response (4) by LiquidCross
Find table size and last access date - response (8) by ToddAWalter
If an object existed prior to turning on usecount, and it has not been accessed since usecount was turned on, then the last access will still be null.
Tactical Queries - forum topic by spbalu
I am having trouble meeting the SLA of tactical queries. We are using applicance 2750 , 2 Node system with 120 AMPs. We have an MQ Series Integrator that sends stored procedure calls to the database. Each Stored Procedure generates approximately 100-120 single amp tactical queries (using primary index) these are mostly deletes and inserts (apart from some regex functions on the input parameter values passed). Typically we receive around 20,000 messages on a daily basis - around 2000 per hour during the business hours. We are not able to process all these requests on daily basis and queue builds up and gets emptied only during saturdays when the call volume is low.
I implemented TIWM and assigned all these to tactical workload. BTW, we are using SLES 11. But i dont any improvement at all even after implementing the tactical workload. we are only able to process around 500-800 messages on average per hours (against 2000 received). The average queries (tactical) submitted to database per hour are around 160K transactions. Most of these run under a second (typically 0.02 to 0.9 seconds). I checked resusagespma table and we almost have free cpu available all say (no flow control situation). Some of things that i cant get around my head is that, same query for instance :
and by the way there are only two workloads defined on the system - Default and tactical for MQSI tactical queries.
Delete from A where PI='xyz';
1) The same query takes some times 0.01 seconds and during some other time 0.8 seconds. Thats a plenty of free cpu time ! (atleast 30% cpu free)
2) The numbers of messages processed per hour keeps changing , during night when there is less activity it goes up 1200 messages per hour and comes down to 500 during day when system is relatively busy. But when these are tactical queries why is this affected by other work on the system?
Is there any thing else i can do to process 2000 messages per hour ?
Thanks in advance.
Tactical Queries - response (1) by dnoeth
Did you check if you're I/O bound?
How do you submit those 100-120 single amp tactical queries within the SP, serially or in parallel?
Do the Inserts/Deletes process the same or different tables?
Recursive Query to List down the Lineage for a Particular Table with Immediate Parents - response (1) by dnoeth
Hi Himanshu,
you probably use the wrong column in your recursive part, old.source instead of new.source.
Data set manipulation - forum topic by SSMMSS
Hi all
am trying to get solution to the following problem. I have the table below and should add ape. to the the values proceeding Damen.mode and the two proceeding values to ADS.
VisitID Position Text
A 1 Storefront
A 2 basket
A 3 Damen.mode
A 4 PE
B 5 ADS
B 6 PE
B 7 PE
B 8 Storefront
Result should look like this
VisitID Position Text
A 1 Storefront
A 2 basket
A 3 Damen.mode
A 4 ape.Damen.mode
B 5 ADS
B 6 ape.ADS
B 7 ape.ADS
B 8 Storefront
Thank you all.
Recursive SQL with update query - response (1) by dnoeth
WITH can only be used with SELECT (just don't ask why):
Note: You can only use this statement modifier with SELECT statements. WITH cannot be used with other DML statements.
There's a workaround, create a Recursive View and use it instead.
Or materialize the Select in a Volatile Table.
teradata insert to identity column? - response (1) by dnoeth
There's no syntax like that in Teradata, you can only create the Identity using GENERATED AS DEFAULT.
But then you must adjust the MINVALUE to the maximum actual value plus one.
Performance of corelated subquery - response (2) by dnoeth
What kind of Correlated Subqueries?
Scalar within the SELECT list?
Using non-equality conditions?
Data set manipulation - response (1) by dnoeth
You didn't tell the actual logic why it's only for those rows.
Looks like it's replace PE with the previous non-PE value
CASE WHEN text_ = 'PE' THEN 'ape.' || LAST_VALUE(CASE WHEN text_ = 'PE' THEN NULL ELSE text_ END IGNORE NULLS) OVER(--partition by ?? ORDER BY Position_) ELSE text_ END
Teradata Error: [3704] '' ('0A'X) is not a valid Teradata SQL token. - response (8) by sh_one
Is this behaviour of the 15.10 ODBC driver a known bug?
Tracking Time When Last Accessed - response (4) by Taha
Thanks Dieter :)
Help! WITH RECURSIVE does not return desired result.. - forum topic by ashish.jn.in
Untitled Page
I have a data set in oracle (img1 in attachment)
ww_id
fmly_nm
given_nm
jnj_supvr_ww_id
000000034654
CLARK
LISA
000000033121
000000033121
ULLMANN
MICHAEL
000000086902
000000086902
GORSKY
ALEX
000000086902
below query in oracle
select a.wwid, LEVEL hier_lvl_no, SYS_CONNECT_BY_PATH(UPPER(a.wwidname)
, ' -> ') rptg_hier from (select to_number(a.ww_id) wwid, a.jnj_supvr_wwid_nbr,
to_number(a.ww_id)||' - '||a.fmly_nm||', '||a.given_nm wwidname from jjcomp.jjeds_emp
a ) a start with a.wwid = (86902) connect by nocycle prior a.wwid = to_number(a.jnj_supvr_wwid_nbr)
gives me following result
wwid
hier_lvl_no
rptg_hier
86902
1
-> 86902 - GORSKY, ALEX
33121
2
-> 86902 - GORSKY, ALEX -> 33121 - ULLMANN, MICHAEL
34654
3
-> 86902 - GORSKY, ALEX -> 33121 - ULLMANN, MICHAEL -> 34654 - CLARK, LISA
how i can generate the same result in TeraData
14.10 ?? i was trying some code using WITH RECURSIVE, however not able to see desired
result..
WITH RECURSIVE recursive_list(wwid,jnj_supvr_wwid_nbr, name, LVL) AS (
SELECT to_number(ww_id) wwid, jnj_supvr_wwid_nbr, MIN( to_number(ww_id) ||' - '||
fmly_nm || ', ' || given_nm) (VARCHAR(1000)), 1 FROM hrops_v.jjeds_emp where to_number(ww_id)
in ( 86902,33121,34654) GROUP BY 1 UNION ALL SELECT to_number(ww_id) wwid, jnj_supvr_wwid_nbr,
to_number(ww_id) ||' - '|| fmly_nm ||', ' || given_nm || ',' || name, LVL+1 FROM
hrops_v.jjeds_emp INNER JOIN recursive_list ON wwid = jnj_supvr_wwid_nbr AND to_number(ww_id)
||' - '|| fmly_nm || ', ' || given_nm > name ) SELECT wwid, LVL, name FROM recursive_list
QUALIFY RANK() OVER(PARTITION BY wwid,jnj_supvr_wwid_nbr ORDER BY LVL) = 1 where
wwid in ( 86902,33121,34654)
can any body please help me to produce
desired result shown above from oracle ??
Tactical Queries - response (2) by spbalu
All these single amp queries are run in serial. when the message comes in, there are about 10-20 tables where delete is submitted and then insert the new record (after some validation is done on the input paramaters, for ex: check if the time and date are valid) into bunch of tables.
Is there any query to check if the system is i/o bound?
Also, i have noticed that many of these queries are having some initial delay,
(FirstStepTime-StartTime) Second(4,6) -> 0.01 to 0.8 seconds and these do not have any corresponding workload delay. How do we interpret this delay ?
Performance Data - forum topic by imaadesi
I have worked with Oracle for many years. I have started working with Teradata recently. Oracle has something very useful to find about performance data and it is dynamic performance view. Is there anything simliar to that in Teradata?
Thanks
Help! WITH RECURSIVE does not return desired result.. - response (1) by Arparmar
HI Ashish,
please check the below SQL , it will give you the desired output.
WITH RECURSIVE RECURSIVE_TEST_1
(
WID,
HIER_LVL_NO,
RPTG_HIER,
JNJ_SUPVR_ID)
AS
(
SEL
WW_ID,
1 ,
WW_ID||'-'||FMLY_NM||','||GIVEN_NM (VARCHAR(1000)),
JNJ_SUPVR_WW_ID
FROM RECURSIVE_TEST
WHERE WW_ID =86902
UNION ALL
SEL
B.WW_ID,
HIER_LVL_NO+1,
RPTG_HIER ||'->'||TRIM(WW_ID||'-'||FMLY_NM||','||GIVEN_NM),
JNJ_SUPVR_WW_ID
FROM RECURSIVE_TEST_1 A
INNER JOIN RECURSIVE_TEST B
ON TRIM(A.WID)=TRIM(B.JNJ_SUPVR_WW_ID)
WHERE HIER_LVL_NO<4)
SEL WID,
HIER_LVL_NO,
RPTG_HIER
FROM RECURSIVE_TEST_1
QUALIFY ROW_NUMBER () OVER ( PARTITION BY WID ORDER BY RPTG_HIER ) =1;
please check and let me know if you have any issue.
Hierarchial Data Sorting - forum topic by JBaskaran
Hi,
I have created a table which have Parents and its Children. But the User Needs a Sort field which gives the expanded Hierarchy of the Parent. Example given below. PLease let me know how to achieve this in Teradata.
Eg:
PARENT -->CHILD
*087P001 -- 087P001
**087P001--0873000
**087P001--087P100
***087P001--0873100
***087P001--0873300
**87P001--087P200
***087P001--0872100
***087P001--0872200
Varchar column reduces to 255 chars in result set - forum topic by ancientwall
Hello, lately I've run into problem with reducing varchar length to 255 chars in query.
Defined table column has varchar(5000) type and when I run simple select ('select name from t_name' for example) result set is fine and contains all field length. But when I try to join this table with other and select same column there is reduced to 255 chars column in result set. I tried use this select to insert into new table with column type varchar(5000) but it inserts only 255 chars whatever. How can I solve the problem? Thanks
Help! WITH RECURSIVE does not return desired result.. - response (3) by ashish.jn.in
Thanks Arun, That worked. now have different issue...
I have created recursive view
Replace RECURSIVE VIEW hrops_v.RECURSIVE_TEST_1 (WID,HIER_LVL_NO,RPTG_HIER,JNJ_SUPVR_ID) AS ( SEL WW_ID,1 , ' -> ' || TRIM(to_number(WW_ID) || ' - '||FMLY_NM||', '||GIVEN_NM (VARCHAR(1000))),JNJ_SUPVR_WW_ID FROM hrops_v.jjeds_emp WHERE WW_ID =86902 UNION ALL SEL B.WW_ID,HIER_LVL_NO+1,RPTG_HIER ||' -> '||TRIM(to_number(WW_ID) ||' - '||FMLY_NM||', '||GIVEN_NM),JNJ_SUPVR_WW_ID FROM RECURSIVE_TEST_1 A INNER JOIN hrops_v.jjeds_emp B ON TRIM(A.WID)=TRIM(B.JNJ_SUPVR_WW_ID) WHERE HIER_LVL_NO<4);
i am looking extra values (fields) so i was trying to create view from recursive view
CREATE VIEW hrops_v.AS_JJEDS_RPTG_HIER_01 AS
SEL WID,HIER_LVL_NO,RPTG_HIER, TRIM(OTRANSLATE(OREPLACE(SUBSTR (rptg_hier || '->', INSTR (rptg_hier || '>', '>', 1, 1 ) + 1, INSTR (rptg_hier || '>', '>', 1, 2 ) - INSTR (rptg_hier || '>', '>', 1, 1 ) - 1 ), '-',''),OTRANSLATE (rptg_hier, '0123456789', ''), '' )) level_1, CASE WHEN HIER_LVL_NO >1 THEN TRIM(OTRANSLATE(OREPLACE(SUBSTR (rptg_hier || '->', INSTR (rptg_hier || '>', '>', 1, 2 ) + 1, INSTR (rptg_hier || '>', '>', 1, 3 ) - INSTR (rptg_hier || '>', '>', 1, 2 ) - 1 ), '-',''),OTRANSLATE (rptg_hier, '0123456789', ''), '' )) ELSE '' END level_2
FROM hrops_v.RECURSIVE_TEST_1 QUALIFY ROW_NUMBER () OVER ( PARTITION BY WID ORDER BY RPTG_HIER ) =1;
i undersood i can not create view from recursive view (is my understanding correct?)
in that case how to generate output as above. any direction?
How to calculate a character occurance in a string in teradata - response (6) by Andrew_S
It's interesting to use a Regular Expression to solve the problem. My query does more than the original question, and of course it could be eaisly simplified.
The query below replaces a set of potential delimeters with a pipe. It also removes consecutive delimeters with nothing between. If an ending delimeter exists, it is removed. Next it removes all characters that are not a delimeter. We can then then count the length of the resulting string.
I wonder if the compiler/optimizer compiles all three into one expression, before executing? And, I wonder if all three regex could be written into just one statement? Also, I haven't found the correct syntax for escaping a single quote, so the single quote could be an accepted delimeter.
SELECT
REGEXP_REPLACE( /* Removes all but pipe */
REGEXP_REPLACE( /* Removes ending delimeters. */
REGEXP_REPLACE ( /* Converts all delimeters to pipes, and removes duplicate consectuive delimeters.
Need to remove terminal delimeter. */
'1/2/3/4/5/6/7/8/9/10'
,'[ /%@.,\\-\\/\x27#()]+'
,'|'
,1
,0
,'i'
)
, '[|]$'
, ''
,1
,0
,'i'
)
, '[^|]'
, ''
,1
,0
,'i'
) AS Pipes_Only
, LENGTH( Pipes_Only )+1 AS Number_of_Words
;
Teradata Tperf isn't a number that can be calculated, it's assiged to each node generation based on tests that have been executed against the node generations hardware. Adding a link that I came across today looking for the tperf numbers for older generation hardware.
http://apps.teradata.com//TDMO/v07n03/Tech2Tech/AppliedSolutions/TeradataPlatform.aspx