From: Andy J. (JIRA) <web...@jp...> - 2007-11-28 11:57:56
|
[ http://www.jpox.org/servlet/jira/browse/RDBMS-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andy Jefferson updated RDBMS-36: -------------------------------- Summary: Retrieval of object using new-table inheritance does one SELECT for each table in the inheritance tree when should do single SELECT for all fields (was: Retrieval of object using new-table inheritance does one SELECT for each table in the inheritance tree) Affects Version/s: 1.2.0-rc-1 > Retrieval of object using new-table inheritance does one SELECT for each table in the inheritance tree when should do single SELECT for all fields > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: RDBMS-36 > URL: http://www.jpox.org/servlet/jira/browse/RDBMS-36 > Project: RDBMS > Issue Type: Improvement > Components: ORM > Reporter: Andy Jefferson > Assigned To: Andy Jefferson > Fix For: 1.2.0-rc-1 > > > When we have an inheritance hierarchy like this > class A { ... } // new-table > class B extends A { ... } // new-table > class C extends B { ... } // new-table > and we do pm.getObjectById(id) this does > SELECT ... (discrim/JPOXMETADATA) ... > to determine the inheritance level of the object, followed by its migration HOLLOW -> PCLEAN > 14:53:57,493 (main) DEBUG [JPOX.Lifecycle] - Object "org.jpox.test.FSub1Sub@2f0df1" (id="6[OID]org.jpox.test.FSub1Sub") has a lifecycle change : "HOLLOW" > ->"P_CLEAN" > 14:53:57,493 (main) DEBUG [JPOX.Persistence] - Object "org.jpox.test.FSub1Sub@2f0df1" having fields "id,name,revision" fetched from table "`FBASE`" > 14:53:57,494 (main) DEBUG [JPOX.Datastore.Retrieve] - SELECT THIS.`ID`,THIS.`NAME`,THIS.`REVISION` FROM `FBASE` THIS WHERE (THIS.`FBASE_ID`=<6>) > 14:53:57,494 (main) DEBUG [JPOX.Datastore.Retrieve] - Execution Time = 0 ms > 14:53:57,495 (main) DEBUG [JPOX.Persistence] - Object "org.jpox.test.FSub1Sub@2f0df1" having fields "description,value" fetched from table "`FSUB1`" > 14:53:57,495 (main) DEBUG [JPOX.Datastore.Retrieve] - SELECT THIS.`DESCRIPTION` FROM `FSUB1` THIS WHERE (THIS.`FSUB1_ID`=<6>) > 14:53:57,496 (main) DEBUG [JPOX.Datastore.Retrieve] - Execution Time = 0 ms > 14:53:57,496 (main) DEBUG [JPOX.Persistence] - Object "org.jpox.test.FSub1Sub@2f0df1" having fields "value" fetched from table "`FSUB1SUB`" > 14:53:57,496 (main) DEBUG [JPOX.Datastore.Retrieve] - SELECT THIS.`VALUE` FROM `FSUB1SUB` THIS WHERE (THIS.`FSUB1SUB_ID`=<6>) > 14:53:57,497 (main) DEBUG [JPOX.Datastore.Retrieve] - Execution Time = 1 ms > so it does a SELECT for each of the tables that it is stored in. This could be merged into > SELECT THIS.`ID`,THIS.`NAME`,THIS.`REVISION`, SUB1.`DESCRIPTION`, SUB2.`VALUE` > FROM `FBASE` THIS > INNER JOIN `FSUB1` SUB1 ON THIS.`ID` = SUB1.`FSUB1_ID` > INNER JOIN `FSUB2` SUB2 ON THIS.`ID` = SUB2.`FSUB2_ID` > WHERE (THIS.`FBASE_ID`=<6>) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://www.jpox.org/servlet/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |