Claims
- 1. A method of combining data, the method comprising:
performing a plurality of merge operations using a single scan of a source data structure, wherein each merge operation is an operation to merge data from the source data structure into at least one of a plurality of destination data structures; wherein each of the source data structure and the destination data structures is a relational data structure; and wherein each of the merge operations includes identifying whether any differences exist between the source data structure and that destination data structure, and modifying that destination data structure based on any identified differences.
- 2. The method of claim 1, wherein performing a plurality of merge operations includes inserting data identified from the scan of the source data structure into one or more of the destination data structures.
- 3. The method of claim 1, wherein performing a plurality of merge operations includes updating one or more of the destination data structures using data identified from the scan of the source data structure.
- 4. The method of claim 1, wherein performing a plurality of merge operations includes deleting data from one or more of the destination data structures using data identified from the scan of the source data structure.
- 5. The method of claim 1, wherein performing a plurality of merge operations includes augmenting the data of the source data stream created from a single scan of the source data structure and based on data obtained from performing one of the merge operations with one of the destination data structures.
- 6. The method of claim 5, wherein performing a plurality of merge operations includes performing one of the plurality of merge operations using the augmented data from the source data stream, without performing another scan that is in addition to the single scan.
- 7. The method of claim 1, wherein performing a plurality of merge operations includes executing a query of the source data structure to perform the single scan of the source data structure.
- 8. The method of claim 1, wherein the source data structure and the plurality of destination data structures are each a table.
- 9. The method-of claim 1, wherein the step of performing a plurality of merge operations is performed within a database system that manages the plurality of destination data structures.
- 10. The method of claim 1, wherein the step of performing a plurality of merge operations includes performing a first merge operation to merge a first portion of a set of data from the source data structure into a first destination data structure in the plurality of destination data structures, and performing a second merge operation to merge another portion of the set of data from the source data structure into a second destination data structure in the plurality of destination data structures, and the different portions of the set of data from the source data structure used for the different merge operations may overlap.
- 11. The method of claim 10, wherein performing a second merge operation to merge another portion of the set of data from the source data structure includes performing the second merge operation to merge all of the set of data from the source data structure into the second destination data structure.
- 12. The method of claim 10, wherein performing a first merge operation to merge a first portion of the set of data from the source data structure into a first destination data structure includes identifying one section of the set of data from the source data structure that first matches a condition for performing the first merge operation, and merging that section of the set of data into the first destination data structure.
- 13. The method of claim 10, wherein performing a first merge operation to merge a first portion of the set of data from source data structure into a first destination data structure includes identifying each section of the set of data from the source data structure that matches a condition for performing the first merge operation, and merging that section of the set of data into the first destination data structure.
- 14. The method of claim 1, wherein performing a plurality of merge operations using a single scan of a source data structure includes returning from a first merge operation in the plurality of merge operations only a portion of a set of data from the source data structure that is being merged in the first merge operation, and wherein the method further comprises performing a second merge operation to merge at least the portion of the set of data from the source data structure into a second destination data structure in the plurality of destination data structures.
- 15. The method of claim 1, further comprising establishing an intermediate data structure to store changes that are to be made to a set of data from the source data structure before performing a second merge operation in the plurality of merge operations to merge the set of data from the source data structure with a second destination data structure.
- 16. The method of claim 15, further comprising determining a manner in which the changes stored in the intermediate data structure are to be made to the set of data from the source data structure before performing the second merge operation.
- 17. The method of claim 16, wherein determining a manner in which the changes stored in the intermediate data structure are to be made to the set of data from the source data structure includes determining whether the changes are to augment the set of data.
- 18. The method of claim 14, wherein performing a plurality of merge operations using a single scan of a source data structure includes augmenting the set of data from the source data stream based on the single scan on the source data structure and on data obtained from performing the first merge operation before performing the second merge operation.
- 19. A computer-readable medium carrying one or more sequences of instructions for combining data within a database environment, wherein execution of the one or more sequences of instructions by one or more processors causes the one or more processors to perform the steps of:
performing a plurality of merge operations using a single scan of a source data structure, wherein each merge operation is an operation to merge data from the source data structure into at least one of a plurality of destination data structures; wherein each of the source data structure and the destination data structures is a relational data structure; and wherein each of the merge operations includes identifying whether any differences exist between the source data structure and that destination data structure, and modifying that destination data structure based on any identified differences.
- 20. The computer-readable medium of claim 19, wherein the step of performing a plurality of merge operations includes the step of inserting data identified from the scan of the source data structure into one or more of the destination data structures.
- 21. The computer-readable medium of claim 19, wherein the step of performing a plurality of merge operations includes the step of updating one or more of the destination data structures using data identified from the scan of the source data structure.
- 22. The computer-readable medium of claim 19, wherein the step of performing a plurality of merge operations includes the step of deleting data from one or more of the destination data structures using data identified from the scan of the source data structure.
- 23. The computer-readable medium of claim 19, wherein the step of performing a plurality of merge operations includes augmenting the data from the source data stream based on the single scan of the source data structure and based on data obtained from performing one of the merge operations with one of the destination data structures.
- 24. The computer-readable medium of claim 23, wherein the step of performing a plurality of merge operations includes performing one of the plurality of merge operations using the augmented data from the source data stream, without performing another scan that is in addition to the single scan.
- 25. The computer-readable medium of claim 19, wherein the step of performing a plurality of merge operations includes the step of executing a query of the source data structure to perform the single scan of the source data structure.
- 26. The computer-readable medium of claim 19, wherein the source data structure and the plurality of destination data structures are each a table.
- 27. The computer-readable medium of claim 19, wherein the step of performing a plurality of merge operations is performed within a database system that manages the plurality of destination data structures.
- 28. The computer-readable medium of claim 19, wherein the step of performing a plurality of merge operations includes performing a first merge operation to merge a first portion of a set of data from the source data structure into a first destination data structure in the plurality of destination data structures, and performing a second merge operation to merge another portion of the set of data from the source data structure into a second destination data structure in the plurality of destination data structures.
- 29. The computer-readable medium of claim 28, wherein the step of performing a second merge operation to merge another portion of the set of data from the source data structure includes the step of performing the second merge operation to merge all of the set of data from the source data structure into the second destination data structure.
- 30. The computer-readable medium of claim 28, wherein the step of performing a first merge operation to merge a first portion of the set of data from the source data structure into a first destination data structure includes identifying one section of the set of data from the source data structure that first matches a condition for performing the first merge operation, and merging that section of the set of data into the first destination data structure.
- 31. The computer-readable medium of claim 28, wherein the step of performing a first merge operation to merge a first portion of the set of data from source data structure into a first destination data structure includes identifying each section of the set of data from the source data structure that matches a condition for performing the first merge operation, and merging that section of the set of data into the first destination data structure.
- 32. The computer-readable medium of claim 19, wherein the step of performing a plurality of merge operations using a single scan of a source data structure includes returning from a first merge operation in the plurality of merge operations only a portion of a set of data from the source data structure that is being merged in the first merge operation, and wherein the computer-readable medium further comprises instructions for performing a second merge operation to merge at least the portion of the set of data from the source data structure into a second destination data structure in the plurality of destination data structures.
- 33. The computer-readable medium of claim 19, further comprising instructions for performing establishing an intermediate data structure to store changes that are to be made to a set of data from the source data structure before performing a second merge operation in the plurality of merge operations to merge the set of data from the source data structure with a second destination data structure.
- 34. The computer-readable medium of claim 33, further comprising instructions for performing the step of determining a manner in which the changes stored in the intermediate data structure are to be made to the set of data from the source data structure before performing the second merge operation.
- 35. The computer-readable medium of claim 34, wherein the step of determining a manner in which the changes stored in the intermediate data structure are to be made to the set of data from the source data structure includes determining whether the changes are to update the set of data or to augment the set of data.
- 36. The computer-readable medium of claim 34, wherein the step of determining a manner in which the changes stored in the intermediate data structure are to be made to the set of data from source data structure includes determining whether the changes are to identify data that is to be deleted from the set of data.
- 37. The computer-readable medium of claim 32, wherein the step of performing a plurality of merge operations using a single scan of a source data structure includes augmenting the set of data from the source data stream based on the single scan of the source data structure and on data obtained from performing the first merge operation before performing the second merge operation.
CROSS REFERENCE TO RELATED APPLICATIONS
[0001] This application is related to U.S. patent application Ser. No. 10/_____ (Attorney Docket No, 50277-2099), entitled METHOD AND APPARATUS FOR PERFORMING MULTIPLE MERGE OPERATIONS USING SOURCE DATA THAT IS MODIFIED IN BETWEEN THE MERGE OPERATIONS, by RICHARD YU GU, HARMEEK SINGH BEDI and ASHISH THUSOO, filed on the same date as this application, the content of which is hereby incorporated by reference in its entirety.
[0002] This application is related to U.S. patent application Ser. No. 10/_____ (Attorney Docket No, 50277-2100), entitled PIPLELINE MERGE OPERATIONS USING SOURCE DATA AND MULTIPLE DESTINATION DATA STRUCTURES, by RICHARD YU GU, HARMEEK SINGH BEDI and ASHISH THUSOO, filed on the same date as this application, the content of which is hereby incorporated by reference in its entirety.
[0003] This application is related to U.S. patent application Ser. No. 10/______ (Attorney Docket No, 50277-2101), entitled TECHNIQUE FOR USING A CURRENT LOOKUP FOR PERFORMING MULTIPLE MERGE OPERATIONS USING SOURCE DATA THAT IS MODIFIED IN BETWEEN THE MERGE OPERATIONS, by RICHARD YU GU, HARMEEK SINGH BEDI and ASHISH THUSOO, filed on the same date as this application, the content of which is hereby incorporated by reference in its entirety.