问题描述
我正在为我的应用程序构建数据库存储,该数据库存储由具有巨大数据量(亿万条记录)的单个表组成.我计划在日期字段上建立索引,因为我会不时地在给定的时间内批量恢复所有记录(例如,检索第二天午夜的所有记录) ).
I'm in the process of building a database storage for my app consisting on a single table with a huge data volume (hundreds of millions of records). I'm planning on having an index on the date field, since I'll be doing a batch recovery of all the records in a given period of time every now and then (for example, retrieving all records for the following day, at midnight).
由于记录数量巨大,并且性能是此系统中的重要问题,所以我想知道是否有一种方法可以对表进行动态分区,以便可以更快地检索记录,创建和截断分区,如下所示:他们不再需要.例如,在处理完今天的记录后,第二天如何创建分区并用其余数据填充分区?
Since the number of records is huge and performance is an important concern in this system, I would like to know if there is a way I can dynamically partition my table so that I can retrieve the records faster, creating and truncating partitions as they are no longer needed. For example, how would I go about creating a partition for the following day and populating it with the rest of the data after I'm done processing today's records?
推荐答案
在11g中,我们可以定义INTERVAL分区,并且Oracle在获取键不适合任何现有范围的新记录时将自动创建新分区.这是一个非常酷的功能. 了解更多.
In 11g we can define INTERVAL partitions, and Oracle will automatically create new partitions when it gets new records whose keys don't fit in any of the existing ranges. This is a very cool feature. Find out more.
要记住的一件事是,在Enterprise Edition许可证的基础上,分区是额外收费的.因此使用起来并不便宜.
One thing to bear in mind is that Partitioning is a chargeable extra on top of the Enterprise Edition license. So it is not cheap to use.
这篇关于Oracle中的动态表分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!