Hi
My opinion is basically to take a look at your sourcecode first and
don't forget to index your tables.
For me, for my typical situation/project I can tell next details :
My Oracle 8 database schema for test contains ~ 15 tables with more than 
300 total defined columns, minimum indexed, with 1:n and n:m relations 
using indirection tables, and a total of more than 200.000 entries and a 
complete test suite where full schema is parsed takes under 20 seconds. 
Some development advice is to take care to create in your source code
one PBKey/PersistenceBroker instance and to cache this for later usage.
Regards,
Cristian
  

-----Original Message-----
From: Ebersole, Steven [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 18. März 2003 15:03
To: OJB Users List (E-mail)
Subject: performance


I am running into a huge performance issue and was hoping to get some
guidance on where to start looking for a problem.  Then mapping portion
causing the problem deals with employees for a company.  I currently have
this modeled as a bi-directional 1:n mapping (Company has a collection of
employees and Employee has a reference to its Company).  Both sides of the
association are set to be proxies (collection-proxy and reference-proxy).

I then tested by loading 2 companies, one with 175 employees and another
with 1524 (the results were pretty much the same querying the Employee
object by its company).  Accessing the employee collection on the first
company took 1.5 secs to load.  Accessing the employee collection on the
second took 2 minutes and 5 secs to load.

Thats not even close to linear, so I am thinking I must be doing something
wrong.  Any help troubleshooting this would be greatly appreciated.  Below
are the mappings for both classes.  I am using the
PersistentFieldMaxPerformanceImpl for the PersistenceFieldClass and a JNDI
Datasource.





<!--
############################################################################
###
##   Company entity type mapping
############################################################################
###
-->
    <class-descriptor
            class="com.vignette.it.apps.server.domain.entities.Company"
            table="COMPANY"
    >
        <field-descriptor
                name="id"
                column="COMP_ID"
                jdbc-type="INTEGER"
                primarykey="true"
                autoincrement="true"
        />

        <field-descriptor
                name="parentId"
                column="PRNT_COMP_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="pending"
                column="PENDING_APPRVL_FLG"
                jdbc-type="INTEGER"
 
conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldCo
nversion"
        />

        <field-descriptor
                name="name"
                column="NAME"
                jdbc-type="VARCHAR"
        />

        <field-descriptor
                name="aliases"
                column="ALIASES"
                jdbc-type="VARCHAR"
        />

        <field-descriptor
                name="numberOfVignetteSites"
                column="NUM_OF_VIGN_SITES"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="annualRevenueAmount"
                column="ANNUAL_REV"
                jdbc-type="DOUBLE"
        />

        <field-descriptor
                name="annualRevenueCurrencyId"
                column="ANNUAL_REV_CURR_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="potentialOpportunityAmount"
                column="POTNL_OPP"
                jdbc-type="DOUBLE"
        />

        <field-descriptor
                name="potentialOpportunityCurrencyId"
                column="POTNL_OPP_CURR_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="fortuneListId"
                column="FORT_LIST_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="geographyId"
                column="GEO_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="customerStatusId"
                column="CUST_PROD_STAT_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="createdBy"
                column="CRTD_BY"
                jdbc-type="VARCHAR"
        />

        <field-descriptor
                name="createdDate"
                column="CRTD_DT"
                jdbc-type="TIMESTAMP"
 
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
ampFieldConversion"
        />

        <field-descriptor
                name="modifiedBy"
                column="CHGD_BY"
                jdbc-type="VARCHAR"
        />

        <field-descriptor
                name="modifiedDate"
                column="CHGD_DT"
                jdbc-type="TIMESTAMP"
 
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
ampFieldConversion"
        />

        <reference-descriptor
                name="parent"
 
class-ref="com.vignette.it.apps.server.domain.entities.Company"
                proxy="true"
        >
            <foreignkey field-ref="parentId"/>
        </reference-descriptor>

        <reference-descriptor
                name="annualRevenueCurrency"
 
class-ref="com.vignette.it.apps.server.domain.entities.Currency"
                proxy="true"
        >
            <foreignkey field-ref="annualRevenueCurrencyId"/>
        </reference-descriptor>

        <reference-descriptor
                name="potentialOpportunityCurrency"
 
class-ref="com.vignette.it.apps.server.domain.entities.Currency"
                proxy="true"
        >
            <foreignkey field-ref="potentialOpportunityCurrencyId"/>
        </reference-descriptor>

        <reference-descriptor
                name="fortuneList"
 
class-ref="com.vignette.it.apps.server.domain.entities.FortuneList"
                proxy="true"
        >
            <foreignkey field-ref="fortuneListId"/>
        </reference-descriptor>

        <reference-descriptor
                name="geography"
 
class-ref="com.vignette.it.apps.server.domain.entities.Geography"
                proxy="true"
        >
            <foreignkey field-ref="geographyId"/>
        </reference-descriptor>

        <reference-descriptor
                name="customerStatus"
 
class-ref="com.vignette.it.apps.server.domain.entities.CustomerStatus"
                proxy="true"
        >
            <foreignkey field-ref="customerStatusId"/>
        </reference-descriptor>

        <collection-descriptor
                name="addresses"
 
element-class-ref="com.vignette.it.apps.server.domain.entities.CompanyAddres
s"
                orderby="hqAddress"
                sort="DESC"
                proxy="true"
        >
            <inverse-foreignkey field-ref="companyId"/>
        </collection-descriptor>

        <collection-descriptor
                name="phones"
 
element-class-ref="com.vignette.it.apps.server.domain.entities.PhoneNumber"
                proxy="true"
                indirection-table="COMP_PHONE_NUM_JT"
        >
            <fk-pointing-to-this-class column="COMP_ID"/>
            <fk-pointing-to-element-class column="PHONE_NUM_ID"/>
        </collection-descriptor>

        <collection-descriptor
                name="vignRelationships"
 
element-class-ref="com.vignette.it.apps.server.domain.entities.CompanyRelati
onship"
                proxy="true"
                indirection-table="COMP_COMP_TYPE_JT"
        >
            <fk-pointing-to-this-class column="COMP_ID"/>
            <fk-pointing-to-element-class column="COMP_TYPE_ID"/>
        </collection-descriptor>

        <collection-descriptor
                name="industries"
 
element-class-ref="com.vignette.it.apps.server.domain.entities.Industry"
                proxy="true"
                indirection-table="COMP_IND_JT"
        >
            <fk-pointing-to-this-class column="COMP_ID"/>
            <fk-pointing-to-element-class column="IND_ID"/>
        </collection-descriptor>

        <collection-descriptor
                name="employees"
 
element-class-ref="com.vignette.it.apps.server.domain.entities.Contact"
                proxy="true"
        >
            <inverse-foreignkey field-ref="companyId"/>
        </collection-descriptor>

    </class-descriptor>








<!--
############################################################################
###
##   Contact entity type mapping
############################################################################
###
-->
    <class-descriptor
            class="com.vignette.it.apps.server.domain.entities.Contact"
            table="COMP_PERS_JT"
    >
        <field-descriptor
                name="id"
                column="COMP_PERS_ID"
                jdbc-type="INTEGER"
                primarykey="true"
                autoincrement="true"
        />

        <field-descriptor
                name="companyId"
                column="COMP_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="personId"
                column="PERS_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="managerId"
                column="MGR_COMP_PERS_ID"
                jdbc-type="INTEGER"
        />

        <field-descriptor
                name="title"
                column="TITLE_1"
                jdbc-type="VARCHAR"
        />

        <field-descriptor
                name="title2"
                column="TITLE_2"
                jdbc-type="VARCHAR"
        />

        <field-descriptor
                name="primary"
                column="PRIMARY_FLG"
                jdbc-type="INTEGER"
 
conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldCo
nversion"
        />

        <field-descriptor
                name="active"
                column="ACTIVE_FLG"
                jdbc-type="INTEGER"
 
conversion="org.apache.ojb.broker.accesslayer.conversions.Boolean2IntFieldCo
nversion"
        />

        <field-descriptor
                name="createdBy"
                column="CRTD_BY"
                jdbc-type="VARCHAR"
        />

        <field-descriptor
                name="createdDate"
                column="CRTD_DT"
                jdbc-type="TIMESTAMP"
 
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
ampFieldConversion"
        />

        <field-descriptor
                name="modifiedBy"
                column="CHGD_BY"
                jdbc-type="VARCHAR"
        />

        <field-descriptor
                name="modifiedDate"
                column="CHGD_DT"
                jdbc-type="TIMESTAMP"
 
conversion="org.apache.ojb.broker.accesslayer.conversions.JavaDate2SqlTimest
ampFieldConversion"
        />

        <reference-descriptor
                name="company"
 
class-ref="com.vignette.it.apps.server.domain.entities.Company"
                proxy="false"
        >
            <foreignkey field-ref="companyId"/>
        </reference-descriptor>

        <reference-descriptor
                name="person"
 
class-ref="com.vignette.it.apps.server.domain.entities.Person"
                proxy="false"
        >
            <foreignkey field-ref="personId"/>
        </reference-descriptor>

        <reference-descriptor
                name="manager"
 
class-ref="com.vignette.it.apps.server.domain.entities.Contact"
                proxy="true"
        >
            <foreignkey field-ref="managerId"/>
        </reference-descriptor>

        <collection-descriptor
                name="addresses"
 
element-class-ref="com.vignette.it.apps.server.domain.entities.Address"
                proxy="true"
                indirection-table="COMP_PERS_ADDR_JT"
        >
            <fk-pointing-to-this-class column="COMP_PERS_ID"/>
            <fk-pointing-to-element-class column="ADDR_ID"/>
        </collection-descriptor>

        <collection-descriptor
                name="phones"
 
element-class-ref="com.vignette.it.apps.server.domain.entities.PhoneNumber"
                proxy="true"
                indirection-table="COMP_PERS_PHONE_NUM_JT"
        >
            <fk-pointing-to-this-class column="COMP_PERS_ID"/>
            <fk-pointing-to-element-class column="PHONE_NUM_ID"/>
        </collection-descriptor>

    </class-descriptor>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to