質問

I have a table with following schema:

MyTable { User_ID, Task_ID, Task_Description } where Task_ID is the primary key.

I wish to partition it on User_ID. Also, new users may be added and I want new corresponding partitions to get created automatically. I went through this (see page-8) and found that Oracle 11g provides Interval partitioning which does similar thing but with intervals.

Can I do the same with User_ID?

役に立ちましたか?

解決

You can't automatically generate a unique partition for each distinct varchar(128) value.

You could hash partition the table. That would not guarantee that every partition had a single, unique user_id value. It would ensure that all the rows with the same user_id were in a single partition and would eliminate the need to do manual partition maintenance.

You could list partition the table. That would require, though, that you explicitly add a new partition when a new user_id value is added.

If the user_id values were strictly predictable, you could probably do something with an interval partitioning scheme on a virtual column. But that seems highly unlikely to be practical.

What is the business problem that you are trying to solve? Why is it necessary to have a single user_id value in each partition? Why are you partitioning the table in the first place?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top