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

Issue with Rank/row_number in table - forum topic by adash-7422

$
0
0

Hi 
 
I have a table with 19 M records and we are using row_number to get ranks on 10/11 cols. Something like:
 
row_number () over (partition by cola,colb,colc,cold  order by col1 desc) rank1,
row_number () over (partition by cola,colb,colc,cold  order by col2 desc) rank2,
row_number () over (partition by cola,colb,colc,cold  order by col3 desc) rank3,
row_number () over (partition by cola,colb,colc,cold  order by col4 desc) rank4,
row_number () over (partition by cola,colb,colc,cold  order by col5 desc) rank5,
.......
row_number () over (partition by cola,colb,colc,cold  order by col10 desc) rank10
 
Along with this we are also selecting 110/15 other columns. 
This query gets aborted either due to spool space issue or due to high CPU utilization.
 
Could any one let me know how to fine tune it?
 
Note: We are using TD13.
 
Thanks.

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



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