![]() |
|
Archives of the TeradataForumMessage Posted: Thu, 09 Aug 2007 @ 09:22:07 GMT
<-- Anonymously Posted: Wednesday, August 08, 2007 20:34 --> Hi, The following SQL has poor performance due to the high skew.
Select activity_prd_id ,
site_id,
user_id,
activity_count ,
rank() over (partition by activity_prd_id , site_id
order by activity_count desc ) activity_count_rank
from tb_test
The PI of table tb_test is (USER_ID, SITE_ID, ACTIVITY_PRD_ID) Explain:
The stats info is like below:
Date Time Unique Values Column Names
07/08/02 00:29:54 8,966,211 USER_ID
07/08/02 00:29:52 15 SITE_ID
07/08/02 00:29:51 1 ACTIVITY_PRD_ID
07/08/02 02:05:12 1,421 activity_count
07/08/06 18:47:13 9,719,467 USER_ID, SITE_ID, ACTIVITY_PRD_ID
07/08/02 00:36:10 15 SITE_ID, ACTIVITY_PRD_ID
We have more than 1000 AMPs, so you can see that the table has very few values of activity_prd_id , site_id and activity_count as well. Is there anybody who can give us some suggestions on this? Thanks
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||