From: <leg...@at...> - 2004-08-17 20:32:17
|
The following comment has been added to this issue: Author: Dave G Created: Tue, 17 Aug 2004 3:27 PM Body: Here is the difference between Hibernate's current batch SQL feature and a feature that is highly desirable. HIBERNATE 1.2 CURRENT BATCH UPDATE: CURRENT - update n rows requires n SQL statements Currently, Hibernate batch feature simply batch many SQL atatements into 1 JDBC call which provides only marginally performance improvement compared to issuing 1 UPDATE statement for all rows. supports the update of n rows via n SQL statements. For example, to update 1 field in 15,000 rows, you must read 15,000 rows into transfer objects using Session, update the 15,000 objects in memory and then perform a Collection update using the Session, which results (in the end) in 15,000 SQL statements of the form UPDATE SET FIELDXYZ = valuexyz WHERE pk = pkvalue. While okay for small result sets, this solution does not scale well for large databases. SUGGESTED FUTURE HIBERNATE ENHANCEMENT - BATCH UPDATES Update n rows requires **** ONE **** SQL statement * This feature would allow you to (1 or more) fields using a filter. This solution would scale better for isolated batch update scenarios. UPDATE table SET FIELD1 WHERE field2=somevalue --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29?page=comments#action_14157 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HBI-29 Here is an overview of the issue: --------------------------------------------------------------------- Key: HBI-29 Summary: Optimize Hibernate for the bulk insertion of related entities Type: New Feature Status: Closed Priority: Minor Resolution: CANNOT REPRODUCE Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate 1.2 Assignee: Reporter: Bradley Leupen Created: Fri, 16 Apr 2004 10:57 AM Updated: Tue, 17 Aug 2004 3:27 PM Environment: Hibernate 1.2, MySql 3.1 Description: It is currently difficult to batch the creation of persistent entities that maintain associations with other entities. Add necessary api to hibernate to support the save or update of a collection of entities. An optimization can be applied in this scenario to group inserts / updates by entity class, or table. This will enable the hibernate engine to utilize batching if available, drastically improving performance over a network. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |