Oracle SQL Plan operation: WINDOW (SORT PUSHED RANK)
create table tq84_tab (
num number,
dat date,
val varchar2(100)
);
-- With the following index, the plan
-- operation WINDOW NOSORT STOPKEY would
-- be used.
--
-- create index tab_ix on tq84_tab(num, dat);
explain plan for
select
dat,
val
from
tq84_tab
where
num = 42
order by
dat desc
fetch first 2 row only;
select * from table(dbms_xplan.display(format=>'basic'));
--
-- ---------------------------------------------
-- | Id | Operation | Name |
-- ---------------------------------------------
-- | 0 | SELECT STATEMENT | |
-- | 1 | VIEW | |
-- | 2 | WINDOW SORT PUSHED RANK| |
-- | 3 | TABLE ACCESS FULL | TQ84_TAB |
-- ---------------------------------------------
drop table tq84_tab;