Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: I just want to join to one more table!

Re: I just want to join to one more table!

From: <jimbo1155_at_my-deja.com>
Date: Thu, 28 Dec 2000 13:47:05 GMT
Message-ID: <92fg8q$8jg$1@nnrp1.deja.com>

In article <92do2r$vit$1_at_nnrp1.deja.com>,   jdarrah_co_at_my-deja.com wrote:
> what does the explain plan show for both queries?
Ok, I'm new, but this shows me where to dig. My actual sql is below. When I run explain plan it says that it's doing table access full on contactphone and contactaddress even though there are indexes on the columns I'm joining on.

SELECT
  ICOUNT,

  TELESALES.CONTACT.LASTNAME,
  TELESALES.CONTACT.FIRSTNAME,
  TELESALES.CONTACTADDRESS.ADDRESS,
  TELESALES.CONTACTADDRESS.CITY,
  TELESALES.CONTACTADDRESS.STATE,
  TELESALES.CONTACTADDRESS.ZIP,
  TELESALES.CONTACTPHONE.PHONE

FROM
   (SELECT sum(TELESALES.ACTIVITY.INQUIRYCOUNT) AS ICOUNT,     TELESALES.ACTIVITY.CONTACTID CID
    FROM
        TELESALES.ACTIVITY ,
        TELESALES.CAMPAIGN
    WHERE
        TELESALES.CAMPAIGN.CAMPAIGNNAME  =  'CommunityLink'
        AND (
TELESALES.ACTIVITY.CAMPAIGNID=TELESALES.CAMPAIGN.CAMPAIGNID  )
        AND TELESALES.ACTIVITY.ACTIVITYTIME
               BETWEEN next_day(to_date('01-12-2000 00:00:00','DD-MM-
YYYY HH24:MI:SS')-6,'Sunday')
               AND next_day(to_date('10-12-2000 00:00:00','DD-MM-YYYY
HH24:MI:SS')-6,'Sunday')
     GROUP BY TELESALES.ACTIVITY.CONTACTID
        )
        ,

 TELESALES.CONTACT,
  TELESALES.CONTACTADDRESS,
  TELESALES.CONTACTPHONE WHERE
    ( TELESALES.CONTACT.CONTACTID=CID )
  AND (
TELESALES.CONTACT.SIEBELCONTACTID=TELESALES.CONTACTPHONE.SIEBELCONTACTID   )
  AND (
TELESALES.CONTACT.SIEBELCONTACTID=TELESALES.CONTACTADDRESS.SIEBELCONTACT ID )

Sent via Deja.com
http://www.deja.com/ Received on Thu Dec 28 2000 - 07:47:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US