Redundant Joins being generated

We currently have a performance issue which is caused by unneccessary
joins executed when navigating across relations. We have two tables call
them tableA and tableB with a relationship between them on columnA.
This is a legacy database (25 years old) and does not have any primary
key or foreign key constraints. tableA is mapped to ClassA and tableB is
mapped to ClassB. If we have an instance of ClassA and navigate to ClassB,
I would expect a simple SELECT query to be executed, but instead a join is
included as well. Each table has 200,000 or so rows, so instead of taking
10s of ms, the query is taking more than a second each time. I have
executed the query I would expect and it does take 10ms, and the hardware
we have is fairly meaty. If there something we have configured incorrectly,
or is the absence of primary and foreign keys causing the issue?
The SQL I would expect is:
select t1.columnA, t1.columnB, t1.columnC from tableB t1 where t1.columnA
= '0123456789'
Instead we get:
select t1.columnA, t1.columnB, t1.columnC from tableA t0 inner join tableB
on t0.columnA = t1.columnB where t0.colu
mnA = '0123456789'
I do not see the need for the join as the value of columnA is known,
making the join redundant.
Here are the details (abbreviated):
Java Classes:
public class ClassA {
private String columnA;
private ClassB classB;
public class ClassB {
private String columnA;
// some other fields
private String columnB;
private String columnC;
SQL Tables:
create table tableA (columnA char(10))
create table tableB (columnA char(10), columnB char(10), column char(10))
package.jdo: We have to lie to the kodo about foreign keys or nothing
works.
<class name="ClassA" objectid-class="ClassAId">
<field name="columnA" primary-key="true"/>
</class>
<class name="ClassB" objectid-class="ClassBId">
<field name="columnA" primary-key="true"/>
</class>
package.mapping:
<class name="ClassA">
<jdbc-class-map type="base" table="tableA"/>
<jdbc-version-ind type="state-image"/>
<field name="classB">
<jdbc-field-map type="one-one" column.columnA="columnA"/>
</field>
<field name="columnA">
<jdbc-field-map type="value" column="columnA"/>
</field>
</class>
<class name="ClassB">
<jdbc-class-map type="base" table="tableB"/>
<jdbc-version-ind type="state-image"/>
<field name="classB">
<jdbc-field-map type="one-one" column.columnA="columnA"/>
</field>
<field name="columnA">
<jdbc-field-map type="value" column="columnA"/>
</field>
<field name="columnB">
<jdbc-field-map type="value" column="columnB"/>
</field>
<field name="columnC">
<jdbc-field-map type="value" column="columnC"/>
</field>
</class>

OK,
My apologies it seems in the aim of simplifying the explanation of what is
occuring I missed some important pieces of information. It seems as though
the redundant joins are only occuring when do a mapping that contains a
constant value.
ie
<field name="classB">
<jdbc-field-map type="one-one" column.columnA="columnA"
column.columnB="XXXXXXXX" />
</field>
And looking at the Section 7.5 of the reference manual the SQL generated
has the redundant join also. Can someone explain why the join is necessary
in these circumstances. All the values of the join columns in tableB are
known, so why does tableA need to be referenced at all?

Similar Messages

  • JOINED inheritance; no primary key joins being generated?

    I'm working with the Sun Application Server version 9. I'm using the javax.persistence APIs in conjunction with EJB3. I've told the app server to generate tables automatically (via toplink; I've set it to drop-and-create tables).
    I have a three-level-deep inheritance hierarchy (like Person extends Party extends BaseObject). BaseObject has its @Inheritance strategy set to JOINED. Everything comes out OK, but I am not seeing any foreign keys being created between the subclass primary keys.
    That is, there is no foreign key that enforces that a Person's PK must refer to a Party's PK, which must, in turn, refer to a BaseObject's PK.
    I've also tried using the @PrimaryKeyJoin annotation, but that doesn't seem to affect the outcome.
    So far this is not a big deal, but I'd like to know if it is a bug in Glassfish/Sun App Server or whether this is by design.
    Thanks,
    Laird

    OK,
    My apologies it seems in the aim of simplifying the explanation of what is
    occuring I missed some important pieces of information. It seems as though
    the redundant joins are only occuring when do a mapping that contains a
    constant value.
    ie
    <field name="classB">
    <jdbc-field-map type="one-one" column.columnA="columnA"
    column.columnB="XXXXXXXX" />
    </field>
    And looking at the Section 7.5 of the reference manual the SQL generated
    has the redundant join also. Can someone explain why the join is necessary
    in these circumstances. All the values of the join columns in tableB are
    known, so why does tableA need to be referenced at all?

  • How to modify the SQL being generated from BC, to fix the issue

    Hi,
    We have seen a strange issue in our implementation.The issue is also reproducible in Vanilla environment.
    In Contact List Applet, if we Query in First Name or Last Name fields in UI, the Query being generated is,showing that, Siebel is Querying for first name in S_POSTN_CON.CON_FST_NAME. This is a normalized column for S_CONTACT.FST_NAME.
    This is causing the performance issue.
    When I check the configuration in Tools for Contact BC's First Name field, it is configured as follows.
    Join = S_CONTACT
    Column = FST_NAME.
    I do not understand, Why it is still querying in S_POSTN_CON.
    Any suggestions on how to fix this issue to make the Query to be performed on S_CONTACT.FST_NAME?
    Regards
    Vamshi

    Hi Vamshi,
    As Robert mentioned, there just happens to be a number of things that need to be analyzed prior to changing the shape of the buscomp that triggers that sql.
    If this siebel performance issue occurs on a production environment, you should certainly look at the performance trend/characteristics of that sql over time and assess its the impact on your business community (...), then carefully identify its -true- root-cause, implement a fix and validate it against a production-like environment in order to verify there is no regression associated with it; once the fix is deployed on your production system, you want to monitor its benefit overtime and on a 24x7 basis…all this may sound very generic yet good practices.
    If you are looking at -effectively- solving this siebel peformance issue (and others...) in a timely manner, best is to have your Siebel Teams 1)use a Siebel-specific performance monitoring software technology built by Siebel Architects (like GMT v1.8.5, more info @ www.germainsoftware.com) that is able to collect 24x7 all the data needed for root-cause analysis(and more..), and 2)have senior siebel architects (like Robert's team) that have successfully solved tones and severe performance and scalability issues for many years, provide technical guidance to your team throughout the resolution process.
    Siebel CRM is a great CRM software solution that is very complex. Every "switch you turn on/off", every customization you built into it may generate performance issues if it is not carefully implemented, optimized, tested...and monitored 24x7 once it is deployed onto your production system.
    Good luck w/ this..
    Regards,
    Yannick Germain
    CEO & Founder
    GERMAIN SOFTWARE llc
    Complete Siebel Performance Monitoring Tool
    21 Columbus Avenue, Suite 221
    San Francisco, CA 94111, USA
    Cell: +1-415-606-3420
    Fax: +1-415-651-9683
    [email protected]
    http://www.germainsoftware.com

  • Test-OutlookConnectivity WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance of an object.

    Hi All,
    When we do a test-outlookconnectivity -protocol:http the result is a success but then we get the following:
    ClientAccessServer   ServiceEndpoint                               Scenario                           
    Result  Latency
    (MS)
    xxxxxxxxxxxx... xxxxxxxxxxxxxx                 Autodiscover: Web service request.  Success   46.80
    WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance
     of an object.
    Object reference not set to an instance of an object.
        + CategoryInfo          : NotSpecified: (:) [Test-OutlookConnectivity], NullReferenceException
        + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Monitoring.TestOutlookConnectivityTask
    So it looks like it's not completing successfully.
    I can't find anything on this in particular, and don't really know how to go about solving it - We are fully up to date, Exchange 2010 Sp2 with Rollup 5-v2
    Any help appreciated!

    hi,
    I have the same issue also on Exchange 2010 SP2 RU5v2
    I ran your command and get the below
    [PS] C:\Installs\report\Activesync>Test-OutlookConnectivity -Protocol:http |FL
    RunspaceId                  : ebd2c626-1634-40ad-a17e-c9a713d1a62b
    ServiceEndpoint             : autodiscover.domain.com
    Id                          : Autodiscover
    ClientAccessServer          : CAS01.domain.com
    Scenario                    : Autodiscover: Web service request.
    ScenarioDescription         :
    PerformanceCounterName      :
    Result                      : Success
    Error                       :
    UserName                    : Gazpromuk.intra\extest_645e41faa55f4
    StartTime                   : 8/21/2013 4:08:50 PM
    Latency                     : 00:00:00.1250048
    EventType                   : Success
    LatencyInMillisecondsString : 125.00
    Identity                    :
    IsValid                     : True
    WARNING: An unexpected error has occurred and a Watson dump is being generated: Object reference not set to an instance of an object.
    Object reference not set to an instance of an object.
        + CategoryInfo          : NotSpecified: (:) [Test-OutlookConnectivity], NullReferenceException
        + FullyQualifiedErrorId : System.NullReferenceException,Microsoft.Exchange.Monitoring.TestOutlookConnectivityTask
     Any help would be greatly appreciated, I also get random failures of OWA, EAS and web services, very frustrating
    I have no errors in the app event log
    thanks
    Faisal Saleem Windows Systems Analyst 07595781867

  • Site Web Analytics - no usage data being generated

    Hello all:
    I have a SharePoint Foundation 2013 farm with 2 WFE - 1 Search Server and 1 DB server.  Search Service Application has been configured and functioning properly.  Usage and health Data Service Application has been created and started.  Usage
    data collection is enabled and the "Analytics Usage" check box is checked.  Usage Data Import and Usage Data Processing timer jobs are scheduled and run successfully.
    But, I still get the following error when I go to the Site Web Analytics "A web analytics report is not available for this site. Usage processing may be disabled on this server or the
    usage data for this site has not been processed yet."
    After doing some research, some folks have suggested the following which has to do with manually enabling the receivers via powershell - which I have done but still no report and same error. 
    http://geekswithblogs.net/bjackett/archive/2013/08/26/powershell-script-to-workaround-no-data-in-sharepoint-2013-usage.aspx
    Other Internet searches indicate that Web Analytics Reports is no longer available in SharePoint Foundation 2013:
    http://blogs.msdn.com/b/chandru/archive/2013/08/31/sharepoint-2013-web-analytics-report-where-is-it.aspx
    http://sharepoint.stackexchange.com/questions/63099/where-is-the-web-analytics-service-in-sharepoint-2013
    There is also a TechNet question which indicate that "Microsoft Support confirmed me there's a bug in SharePoint Foundation 2013 in the Database that's going to be fixed in the June or August CU"
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/5372109c-8a6e-4d31-aa34-13b6cbde52cf/sharepoint-foundation-2013-web-analytics?forum=sharepointgeneral
    But, there is no resolution if this bug has been addressed or not.
    Therefore, I would really like to know what the deal is with this issue.  At the moment, I do not see any usage data being generated on any of the SharePoint Foundation servers in the farm.
    Please advise.
    Thank you,
    Rumi

    Hi Rumi,
    Find a same issue internaly which says that the links Site Web Analytics is no longer valid in SharePoint 2013 Foundation due to the changes in analytics service application architecture, so you may need the SharPoint enterprise edition for using
    this feature. 
    Symptom
    - Recently, we upgraded to SharePoint Foundation 2013 from WSS 3.0. In SharePoint Foundation 2013 sites, we see the option to click on Site Web Analytics reports but when we click on it, we get an error.
    - Clicking on Site Web Analytics reports from Site Settings \ Site Actions produces the error: “A web analytics report is not available for this site. Usage processing may be disabled on this server or the usage data for this site has not been processed yet.”
    - We have ensured we have logging enabled (multiple categories)
    - Example Site: http://sharepoint2/sites/IT/Projects/SAP/_layouts/15/usageDetails.aspx
    Cause
    By Design
    1) The links in Site Settings from a site collection are no longer valid in SharePoint 2013 (due to change in Analytics Service application architecture changes...part of Search Service now)
    2) SharePoint Foundation 2013 does not support Usage Reporting Analytics
    Resolution
    o Purchase a license for SharePoint Server 2013 Enterprise, and build out a farm for it (the Foundation SKU cannot be upgraded in-place to Server).
    o Once built up, you could copy your databases over and attach them to the Server farm and do your cutover.
    o Going forward from there, you would be able to have access to the Usage reports.
    Also as you have found that msdn blog with the explenation that it is not available in SPF 2013.
    http://blogs.msdn.com/b/chandru/archive/2013/08/31/sharepoint-2013-web-analytics-report-where-is-it.aspx
    http://technet.microsoft.com/en-us/library/jj819267.aspx#bkmk_FeaturesOnPremise
    Thanks,
    Daniel Yang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Daniel Yang
    TechNet Community Support

  • "The report is being generated. Please try again later. " for last 4 hours

    Hi,
    I am try to check the report function which the azure portal has for Azure Active Directory Premium. However, it's showing "The report is being generated. Please try again later." everywhere for
    4 hours already.
    Is there anybody can help me to figure it out what's happen?  Maybe I miss something?
    Thanks!
    Kevin

    Hello,
    Since we have not heard back from you we are archiving the thread.
    Please let us know if you are still facing the issue.
    Regards,
    Neelesh

  • BPM alert not being generated

    Hi guys,
    I'm having quite a little trouble in doing one thing which has been done for several times but which is giving  me a hard time...
    I've created a bpm process which in an error condition will trigger a simple alert.
    I've tested the process and everything goes allright, except the alert. What is happening? Well, the alert is not being sent to my inbox. Why? Maybe because the alert is not being generated.
    I've went to sxmb_moni_bpe and everything is OK. I can see the message of the alert being fired. After that I went to slg1 to see if my alert is being generated, and the answer is no. It's not being generated....
    I've gone through Michal's blogs and everything was checked...The question is, if I execute RSALERTTEST with my alert category, the alert is generated and send to my inbox. Do you have any ideas?
    Thanks a lot for your attention

    Hi,
    Yes the job scheduling is needed only for Sp14 and below.
    Can you recheck if the Alert is actually getting triggered or not in the BPM in the control step? Make sure that you have given the correct Alert Category in your Control Step and also, make sure that the recipient in your alert as well as the Alert Inbox entry you are seeing is the same.
    Finally, refresh the Alert Inbox.
    Regards,
    Bhavesh

  • SWF File not being generated by compiler

    I am using Flash Builder 4.5.
    One of the modules that compiles without error is still not being bound into the runtime image (in this case debug).
    There are no compiler errors (auto build is switched ON) but a swf file is not being generated.
    I have tried removing the reference to the module in the Project ->Properties->Modules window and then adding it back in to no avail.
    This was working up until I made a change to the module in question and then saved it.

    I would check all imported images in the library. If you cannot see the image in your library preview; there is a good chance that there is an issue and it will need to be reimported.

  • Spool file not being generated in production server

    Hello
    Our end users are using automatic payment program F110 to print multiple cheques.
    The settings in SPAD are identical in Quality and Production Server,but some how
    spool file is not being generated in production.
    Test printing is fine in Quality server.
    Printer being used is Epson LQ 300.Device type is EPESCP2.
    We are using z custom page size ,and it is assigned to printer device Type as well
    Would be very great if some can can comment on which settings to check,as SPAD setting is
    same in both server ,yet no spool.Very Very urgent.
    Iam not sure ,whose domain is it now-BASIS or ABAP.
    Thanks a lot
    Nouman

    If there is a problem with the spool, the variant that is being in F110 parameters.
    As you are saying the quality system is working fine, please compare both the variants in Production and Quality systems.
    This should solve your situation.

  • Notifications are not being generated for any emails that have rules applied to them.

    Notifications are not being generated for any emails that have rules applied to them. Any clues how to fix this?

    In System Center 2012 Operations Manager, the alert notification will be sent when the alert first meets all criteria, regardless of resolution state, unless resolution state itself is a criterion. If alert suppression is enabled for the rule or monitor
    that raises an alert, only one notification will be sent when the subscription criteria are first met. No additional notifications will be sent until the alert is closed and a new alert is raised that meets all subscription criteria.  PLease check
    1) whether your rule has trun on alert supression
    2) Close the alert, craised by rule,  and do it again
    Roger

  • Logs not being generated

    I have two wfe servers, in one server the logs file are being generated but another server no log files only usage files
    what could be the reason. Under central admin monitoring uls logs have been already enabled.

    Hi Rizzk,
    Have you solved this issue?
    Have you checked and added the service account for SharePoint Services Tracing in local group Performance Log Users or Administrators on SharePoint server, then restart this service?
    http://www.justinkobel.com/post/2013/06/07/Solving-ULS-Log-Files-Being-Created-But-Empty-(0-Kb).aspx
    http://sharepointinsight.wordpress.com/2010/04/05/solution-for-zero-byte-sharepoint-2010-log-files/
    Thanks
    Daniel Yang
    TechNet Community Support

  • Emails not being generated using UDF

    Hi,
    We had setup a functionality to send email via UDF using the following blog.
    Mail without email adapter? Part - I - Process Integration - SCN Wiki
    This worked fine for some time. However, it does not generate emails anymore. There were no changes done on the objects. We checked the java mail service settings as suggested in some of the SCN posts and everything looks configured fine.
    We are not able to determine what is preventing the emails from being generated. Any pointers would be really helpful.
    We are using SAP PI 7.31 java only installation.
    Thanks,
    Ravi

    Hi Ravi,
    Did you check SMTP services availability?
    SMTP Configuration in SAP XI - Process Integration - SCN Wiki
    Regards,
    Krupa

  • Reports not being Generated

    I use Crystal Reports with another program that supposed to generate 2 reports with a click of a button, but it is not working. The reports are not being generated. I installed Crystal Reports on my system twice and there doesn't seem to be a problem with the installation, but the program is not working. Please help.

    I am fairly new at this so let me try my best to answer these questions:
    Crystal Reports  XI
    Visual Studio? Not sure
    No service pack applied. How and where do i get it?
    I am using Windows XP
    I am not viewing the reports as it has to be generated before i am able to view and the systems does nothing after I click the generate button
    No  have not tried to view a single report; i don't know how.
    I have not used Crystal reports designer for anything else.
    Edited by: Sharon Aird on Dec 1, 2008 5:05 PM

  • Traces are not being generated

    hi,
    I have 9.1.0.8 database on windows 2003 (32 bit). I am suing following statement to start system wide tracing but i don't see any tarces being generated at user_dump_dest location. any idea what is going wrong and what thing i am missing?
    ALTER SYSTEM SET EVENTS '10046 trace name context forever, level 8';
    Timed_statistics is set to true
    Salman

    Strange - what you have done should work, it works on my 10G database OK.
    Sorry but dont have much else to add ...
    I presume that if you just do it at session level it works ok?
    ALTER SESSION SET EVENTS '10046 trace name context forever, level 8';

  • Spool Request Not being Generated.

    HI,
    when ever a PO is delivered as O/P spool request is not generated.
    if we choose LP01 as printer Spool is being generated. if client printer or LOCAL printer is selected spool
    is not generated. is there any settings to be done for generating the SPOOL request?
    i need to get the O/P as well as i need to view the O/P in Spool also... please help me on this.
    Regards,
    Dinesh R

    Hi,
    go to SPAD-->check the spool setting generally for some outputs the if you check delete spool after output
    then the spool will be deleted once the print is taken.
    remove the setting ..
    or go to t-code SU01 -->Under spool control -->remove the check mark for Delete after Ouput.
    Regrds,
    Prabhudas

Maybe you are looking for

  • Item text in BAPI_PO_Change

    Dear Expert, I used BAPI_PO_Change for add the item text. text = 'Completed'. s_bapimepotext-TEXT_LINE = text. call function 'BAPI_PO_CHANGE'   exporting     purchaseorder                = p_ebeln TABLES    RETURN                       = i_return   

  • Is Apple ever going to address this force reload problem in Safari?

    Seriously, Safari 5.1 is, for all intents and purposes, completely disabled now.  I leave a lot of windows and tabs up at any given time, and when I return to a window after having been someplace else (usually coding in a plain text environment), the

  • How do I get JPGs to show up crisp in my video??

    When I use JPGs in adobe premier (no matter what resolution) the text on them becomes pixelated and illegible. What can I do to render the text on a jpg so that it is crisp and can be read. is there a better format? tiff? gif? do I have to render the

  • Trying to interface Keithley 2400 Sourcemete​r using RS 232.

    When I use the basic serial read and write vi, I get a "Keithley I*" at visa read, and I also get the following data - bytes read - 83 string read - KEITHLEY\sINSTRUMENTS\sINC.,MODEL\s2400,1092330,C2​7\s\s\sFeb\s\s4\s2004\s14:58:04/A02\s\s/K/J\r\n I

  • Not enough CPU power

    Lately, my Mac has randomly been crashing. So, the first solution I tried so far, is to replace the RAM. So, I had upgraded to 16GB instead of the default 4GB, but if I still run an application (mainly videos, or a game), the CPU being consumed by th