cancel
Showing results for 
Search instead for 
Did you mean: 

Is a reverse index scan distinquished from an index scan?

MCMartin
Participant
2,212

Is a reverse index scan distinquished from an index scan in a the plan of the optimizer.

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

Yes, if the optimizer chooses a reverse index plan then it will distinguish this in the plan.

Example:

create table foo( i int primary key);
insert into foo( i ) select row_num from sa_rowgenerator( 1, 999999 );
commit;
select explanation( 'select i from foo where i between 333333 and 333444 order by i asc' );
--> result is foo<foo(IO)>
select explanation( 'select i from foo where i between 333333 and 333444 order by i desc' );
--> result is foo<foo(R,IO)>

Note that the 'R' in the second plan means "reverse".

MarkCulp
Participant

FWIW: I see that 'R' is missing from the [list of plan abbreviations][1] in the docs - I will ask to have it added.

[1] http://dcx.sybase.com/index.html#1201/en/dbusage/abbreviations-plan-queryopt.html

Answers (0)