Create partitioned table

Giganews Newsgroups
Subject: Create partitioned table
Posted by:  simon (zupan.n…@gmail.com)
Date: Mon, 21 Mar 2011

I would like to create 2 partitions on my table, one for active
lines(small number of rows) and one for historical lines(large number
of rows).
So, I created bit column activeLine (1 - active, 0 - unactive) which I
would like to use for filtering the partition.

Then I created partition function:
CREATE PARTITION FUNCTION pf_myTable_active(BIT)
AS RANGE RIGHT FOR VALUES
(0)

and partition scheme:

CREATE PARTITION SCHEME ps_myTable_active
AS PARTITION pf_myTables_active
TO(PrimaryScheme, SecondaryScheme)

When I read I always use activeLine=1 in my query so I'll always read
active parition with small number of rows. I'll read activeLine=0 only
sometimes when I would need historical data.
Is this ok scenario?

Is there some query or report which returns all partitioned tables
with all belonging data of partitions(function, scheme, column...)?

Thank you,
Simon

Replies