Archives of the TeradataForum
Message Posted: Sat, 25 Jul 2015 @ 09:17:12 GMT
| Subj: || || Re: Finding the MAX |
| From: || || Dieter Noeth |
Roopalini Bakthavachalam wrote:
| ||Forum - There is this table A with 2.9 B records and it has 25 columns. Now I need to insert the records from table A into another table B
with a slightly different structure after finding the MAX (one of VARCHAR columns) of table A based on 4 columns of table A which are not part of
PI. Now when I am trying to use MAX(COLUMN 10) OVER (PARTITION BY COL 3, COL 4, COL 5, COL 6) , the INSERT is running for more than an hour. I
believe this is due to the fact that the 4 columns (3,4,5, AND 6) on which I am partitioning on is not part of the PI. Is there anything that I
can try to bring down the execution time or is the only way to have those 4 columns part of the index?|| |
What's the definition of those columns used in the OLAP function? VARCHAR is expanded to CHAR within GROUP BY/PARTITION BY/ORDER BY.
Can you check DBQL for spool usage?
You might also try to remove all columns you don't need for calculation from that query and then join back to the full table using the
This will help reducing spool the record size is quite large.