From: Costantino C. (JIRA) <web...@jp...> - 2009-05-30 23:15:34
|
[ http://www.datanucleus.org/servlet/jira/browse/NUCDBFO-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Costantino Cerbo updated NUCDBFO-37: ------------------------------------ Attachment: newpatch.zip > Make persisting an object that has a primary key (annotation @PrimaryKey) faster. > --------------------------------------------------------------------------------- > > Key: NUCDBFO-37 > URL: http://www.datanucleus.org/servlet/jira/browse/NUCDBFO-37 > Project: DataNucleus DB4O > Issue Type: Improvement > Components: Persistence > Affects Versions: 1.0.1 > Environment: linuy fedora 10, datanucleus-db40-1.1.0 > Reporter: Costantino Cerbo > Attachments: newpatch.zip, patch.zip > > > When the datastore is db4o, using a primary key (annotation @PrimaryKey) makes the performance of persisting an object very slow. > This happens because before persisting a retrieve is done, see logs below: > 00:45:49,806 (main) DEBUG [DataNucleus.Connection] - Connection found in the pool : [org.datanucleus.store.db4o.ConnectionFactoryImpl$ManagedConnectionImpl@18c5e67, /home/c.cerbo/workspaces_eclipse/text-analysis/trunk/Repository/resource/eu/kostia/repository/initrepo/en.db] > 00:45:49,806 (main) DEBUG [DataNucleus.Datastore.Retrieve] - Object "eu.kostia.repository.tokenizer.Abbreviation@181efb9" (id="2078978489099167307") being retrieved from DB4O > 00:45:49,808 (main) DEBUG [DataNucleus.Datastore.Retrieve] - Execution Time = 2 ms > 00:45:49,808 (main) DEBUG [DataNucleus.Connection] - Connection found in the pool : [org.datanucleus.store.db4o.ConnectionFactoryImpl$ManagedConnectionImpl@18c5e67, /home/c.cerbo/workspaces_eclipse/text-analysis/trunk/Repository/resource/eu/kostia/repository/initrepo/en.db] > 00:45:49,808 (main) DEBUG [DataNucleus.Datastore.Persist] - Object "eu.kostia.repository.tokenizer.Abbreviation@181efb9" being inserted into DB4O with all reachable objects > 00:45:49,809 (main) DEBUG [DataNucleus.Datastore.Persist] - Execution Time = 1 ms > 00:45:49,809 (main) DEBUG [DataNucleus.Datastore] - Object "eu.kostia.repository.tokenizer.Abbreviation@181efb9" (id="2078978489099167307) persisted to DB4O > As the table size increases, retrieving takes of course always more time and persisting a very simple object may take even 100 ms! > Using an IdentityType DATASTORE and no Primary Key is the workaround to improve the performance (a lot! in my easy test case more than 300 times!) > This issues aims to reduce the performance gap between persisting object with and without primary key. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://www.datanucleus.org/servlet/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |