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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Can somone optimize this Query?

Re: Can somone optimize this Query?

From: Mark G <mgumbs_at_hotmail.com>
Date: Tue, 12 Oct 1999 09:04:08 +0100
Message-ID: <3802e8c7.0@145.227.194.253>


How large is the person table?
Is person_id indexed?
Bear in mind that because of your outer join, it will do a full table scan on the second person table which will slow things down.

M

<vlee_at_jps.net> wrote in message news:7tu84q$u7f$1_at_nnrp1.deja.com...
> This query hangs up our system dramatically. Can anyone tell me a good
> way to optimize this?
>
> SELECT DISTINCT p.personid, p.first_name, p.last_name, p.username,
> p.address1, p.address2, p.city, p.state, p.zip, p.company_name,
> p.phone1, p.fax, p.ref_personid, p2.viewable, nvl((p2.last_modified -
> p.last_modified), 0) as difference FROM person p, person p2 WHERE
> p.ref_personid = p2.personid(+) AND p.ownerid = 25971 ORDER BY 3 ,
> p.last_name, p.first_name
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Tue Oct 12 1999 - 03:04:08 CDT

Original text of this message

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