SQL Performance (MOSC)

MOSC Banner

select count(1) from table versus select count(1) from table partition

edited June 2015 in SQL Performance (MOSC) 7 commentsAnswered

Hello

I am comparing the explain plan for the two selects

select count(1) fromTABLE  partition (P_CURRENT);

and

select count(1) from TABLE


I noticed that in the first case explain plan shows INDEX FULL SCAN and in the second case explain plan shows INDEX FAST FULL SCAN. There are no difference in the explain plans besides that step

The second query finishes significantly faster than the first one (.25s versus 2+s ). Both queries use the same index  which is nonunique and nonpartitioned.

Can someone suggest what could be  the reason for the difference in the explain plan?


Thank you

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center