Hello,
i have a performance problem with rownum selection when i use a number less than 10, oracle doesn't use the good index
this is my SAP production database
i made a copy of this database (300go) on another server, it's working correctly
select * from sapr3.ekpo
where mandt='100' and afnam='A' and rownum<10
explain :
SELECT STATEMENT Cost = 33
COUNT STOPKEY
TABLE ACCESS BY INDEX ROWID EKPO
INDEX RANGE SCAN EKPO~A
response time 0.03
select * from sapr3.ekpo
where mandt='100' and afnam='A' and rownum<9
explain:
SELECT STATEMENT Cost = 35
COUNT STOPKEY
TABLE ACCESS BY INDEX ROWID EKPO
INDEX SKIP SCAN EKPO~FPL
response time 3.2
Indexes :
EKPO~FPL : FPLNR MANDT
EKPO~A : MANDT AFNAM BSTYP