Patent ID: 7933935

Claim:
A method for loading an XML document into a selected database table partition of a partitioned database table without reading the entire XML document into a buffer, wherein selection of the database table partition requires partition key information from the XML document, the method comprising: beginning reading, from a source into the buffer, an XML document; after reading into said buffer one or more portions of the XML document that include the required partition key information for the selection of the database table partition of the partitioned database table and without reading into said buffer one or more other portions of the XML document that include other information that is not required for selection of the database table partition, performing: detecting that the one or more portions include the required partition key information for the selection of the database table partition of the partitioned database table, wherein the partitioned database table is divided into multiple partitions and stores a collection of XML documents, wherein each XML document of said collection is stored in a single partition selected for said each XML document based on information in said each XML document; in response to detecting that the one or more portions include the required partition key information for the selection of the database table partition: based at least in part on the required partition key information from said portion of said XML document, selecting the database table partition of the partitioned database table to store the XML document; and storing a read part of the XML document stored in the buffer to the selected database table partition, wherein the read part of the XML document includes the one or more portions; after storing the read part of the XML document to the selected database table partition, reading and storing a remainder of the XML document from the source to the selected database table partition, wherein the remainder includes the one or more other portions of the XML document that include the other information that is not required for selection of the database table partition, wherein the method is performed by one or more computing devices.