Patent ID: 8135688

Claim:
A method for managing data storage spaces in a database stored upon one or more computer-readable media, comprising: in response to one or more requests that collectively define at least a first partition and a second partition to create within a table in the database, the table comprising a plurality of partitions including the first partition and the second partition, storing metadata defining a partition mapping, without allocating a region in the one or more computer-readable media for storing data items belonging to at least the second partition of the plurality of partitions; wherein the partition mapping indicates, based upon one or more characteristics of data items that are to be stored in the table, in which of the plurality of partitions a given data item of the data items is to be stored; while maintaining the metadata defining the partition mapping, without having yet allocated a region in the one or more computer-readable media for storing any data items belonging to the second partition: processing a first instruction to insert a first item into the table; in response to the first instruction, based at least on the partition mapping and one or more values in the first item for the one or more characteristics, selecting the first partition as a partition in which the first item is to be stored; identifying a first region in the one or more computer-readable media that has already been allocated for storing data items belonging to the first partition; responsive to the first instruction, storing the first item in the first region of the one or more computer-readable media; processing a second instruction to insert a second item into the table, wherein the first instruction is different than the second instruction; in response to the second instruction, based at least on the partition mapping and one or more values in the second item for the one or more characteristics, selecting the second partition as a partition in which the second item is to be stored; and in response to selecting the second partition, determining that no region has been allocated in the one or more computer-readable media for storing data items belonging to the second partition; in response to the determining that no region has been allocated in the one or more computer-readable media for storing data items belonging to the second partition, allocating a second region in the one or more computer readable media for storing data items belonging to the second partition; responsive to the second instruction, storing the second item in the second region; wherein the method is performed by one or more computing devices.