Database Tuning (MOSC)

MOSC Banner

Partition Pruning

edited Mar 12, 2011 2:38AM in Database Tuning (MOSC) 4 commentsAnswered
  Hi,

I have a table with 2 billion rows range partitioned (monthly) with timestamp data type. Please see the sample column data output.
Quote:
15-APR-10 09.09.54.000000 PM
22-APR-10 03.46.53.000000 PM
18-APR-10 12.25.01.000000 PM
20-APR-10 12.45.12.000000 PM
15-APR-10 11.46.47.000000 PM
21-APR-10 11.53.44.000000 PM
19-APR-10 02.05.53.000000 PM
18-APR-10 09.41.38.000000 PM
19-APR-10 03.37.56.000000 AM
Please find the where clause predicate from the query I am using. Actual partition column is renamed as COLUMN_NAME in the below query.

Quote:
to_number(TO_CHAR(A.COLUMN_NAME,'YYYYMM')) between
to_number(to_char(ADD_MONTHS(to_date(to_char('20101130'),'YYYYMMDD'),-3),'YYYYMM'))
and to_number(to_char(ADD_MONTHS(to_date(to_char('20101130'),'YYYYMMDD'),-1),'YYYYMM'))

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

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