I am new to Teradata, Kindly let me know what is mean by STATS FUNCTION in teradata. Or what it does.
In the Explain plan of query,
"We do an All-AMPs STAT FUNCTION step from Spool 1475 (Last Use) by way of an all-rows scan into Spool 1484, which is redistributed by hash code to all AMPs. The result rows are put into Spool 1482, which is redistributed by hash code to all AMPs."
What its exactly doing in this step. Due to this my query is stuck in this step.
Urgent help required.
Please check below link :
Try to use sample in place of TOP .
SELECT * FROM table SAMPLE 10;
What's the remaining text of this step?
STAT FUCTION step might be TOP or a Windowed Aggregate Function like RANK or SUM OVER.
The query is stucked in 7th step. It is not executing. I am unable to get the output.
Kindly suggest how to overcome from STATS Function.
The query is....
Has this query run ok before?
I can't duplicate this query because of it's size, but one thing to try is to remove the distinct clause on the aggregates and replace with a group by on the non aggregate columns. Try explaining to see if the plan is better.
Step 7 is one of the ROW_NUMBERs, both are a bit strange as they PARTITION and ORDER BY the same columns. You might simply change the ORDER BY to ORDER BY 1 instead.
And you might not need them at all, because they're only used in the outer COUNT(DISTINCT...) and you dont need them IMHO, try count(distinct D1.c17), this should return the same result.
Do you think here I am missing any stats ?? I checked all the stats are up to date.
Do I need to change the query ? or without changing the query we can tune this query. ?
Previously this query was running fine. Plz help me to tune this query.
What do you mean by "Previously this query was running fine"?
Exactly the same query, similar data?
Can you check if DBQL step/explain information is available for the previous run?
Is the estimated number of rows close to the actual number?
What's the size of your system and what's your TD release?
As per our developer team, this query is not new in the system. They are using this query from long back.
TD release is 13.10 and total size of system is 36 TB. Out of 36TB, 11 TB is in used.
Ask the developer team if they got DBQL information or an old Explain for this query, then you can spot differences and start investigating.