Re: Table Partition Count

From: Jonathan Lewis <>
Date: Sat, 28 Nov 2009 13:51:57 -0000
Message-ID: <>

"MBPP" <> wrote in message
> "raja" <> wrote in message
> > 3. How generic do you want the query to be ?
> > Sorry, cant understand.
> It is a long time I did this but I suppose there is a "partition
> (name)" statement specific for this in selects. Try this, I am not
> sure since what version it works:
> select count(*) from t1 partition(part1);
> select count(*) from t1 partition(part2);
> select count(*) from t1 partition(part3);
> select count(*) from t1 partition(part4);
> select count(*) from t1 partition(part5);

This explains the meaning of my "generic" question fairly well. The solution is only good for one table at one particular moment, because if you want to change the table you have to find out all the new partition names, and edit every line of code. Even if you want to check the same table, you may have dropped and added some partitions since last time.

Of course, Matthew supplied a solution using pl/sql that implemented this specific method with a generic mechanism.


Jonathan Lewis
Received on Sat Nov 28 2009 - 07:51:57 CST

Original text of this message