exadata

Window functions SORT costly, can we overcome it?

若如初见. 提交于 2019-12-06 06:18:22
问题 My Requirement: Identify top 10 accounts of a DEPT_NUM , ordered by the account number in ascending order. Query: SELECT * FROM ( select acctnum,dept_num,row_number() OVER (PARTITION BY DEPT_NUM ORDER BY ACCTNUM) as row_identifier FROM MYTABLE ) WHERE row_identifier between 1 and 10; Trace: 7532 rows selected. Execution Plan ---------------------------------------------------------- Plan hash value: 1480074522 -----------------------------------------------------------------------------------

Window functions SORT costly, can we overcome it?

怎甘沉沦 提交于 2019-12-04 11:27:23
My Requirement: Identify top 10 accounts of a DEPT_NUM , ordered by the account number in ascending order. Query: SELECT * FROM ( select acctnum,dept_num,row_number() OVER (PARTITION BY DEPT_NUM ORDER BY ACCTNUM) as row_identifier FROM MYTABLE ) WHERE row_identifier between 1 and 10; Trace: 7532 rows selected. Execution Plan ---------------------------------------------------------- Plan hash value: 1480074522 -------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | ------------------------