CREATE TABLE keyset_demo (a INTEGER, ts date, id integer primary key); INSERT INTO keyset_demo SELECT mod(level, 1000), CURRENT_TIMESTAMP - INTERVAL '1' SECOND * DBMS_RANDOM.normal()*86400, level FROM DUAL CONNECT BY level < 65536 * 16; CREATE INDEX keyset_demo_ids ON keyset_demo (a, ts, id); ALTER SESSION SET statistics_level = ALL; SELECT * FROM ( SELECT keyset_demo.* FROM keyset_demo WHERE a = 17 AND ts = '2015-12-12 08:41:05' and id > 547 OR a = 17 AND ts > '2015-12-12 08:41:05' OR a > 17 ORDER BY a, ts, id ) t WHERE rownum <= 5 ; SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(null, null, 'LAST ALLSTATS')); SELECT * FROM ( SELECT keyset_demo.* FROM keyset_demo WHERE a >= 17 AND NOT (a = 17 AND ts <='2015-12-12 08:41:05') AND NOT (a = 17 AND ts = '2015-12-12 08:41:05' AND id <= 547) ORDER BY a, ts, id ) t WHERE rownum <= 5 ; SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(null, null, 'LAST ALLSTATS')); SELECT * FROM ( SELECT keyset_demo.*, rownum rn FROM keyset_demo ORDER BY a, ts, id ) t WHERE rn > 17833 AND rn <= 17838 ; SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(null, null, 'LAST ALLSTATS'));