Results 1 to 2 of 2

Thread: Join Question

  1. #1
    Join Date
    Mar 2003
    Posts
    6

    Unanswered: Join Question

    Sort of an esoteric question:

    In a transaction with several joins that depend on the prior join statement, does the subsequence join attach to the previous table in its entirety or just the result of it's join?

    Example:

    INNER JOIN FS_COHeader HDR
    ON DTL.COHeaderKey = HDR.COHeaderKey

    INNER JOIN Mfg_SHIPDTL SHPDT
    ON SHPDT.OMON = HDR.CONUMBER
    AND SHPDT._DATESHIP_OwnRec = 11

    LEFT OUTER JOIN Mfg_DFSHIP DFSHP
    ON DFSHP._SHPLINE_OwnRow = SHPDT._Row


    Now will this statement:

    LEFT OUTER JOIN Mfg_DFSHIP DFSHP
    ON DFSHP._SHPLINE_OwnRow = SHPDT._Row

    JOIN with the results of this one:

    INNER JOIN Mfg_SHIPDTL SHPDT
    ON SHPDT.OMON = HDR.CONUMBER
    AND SHPDT._DATESHIP_OwnRec = 11

    Or will it JOIN to the entire (previous) table?

  2. #2
    Join Date
    Jul 2002
    Location
    IA
    Posts
    28
    Use Query Analyser's 'Display Estemated Execution Plan' (ctrl-l) and look for the joins doing table scans for your exact problem. I'd say it should use the subset from the previous join.
    Thanks,
    Jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •