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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Slow running Query.

Re: Slow running Query.

From: Wolfgang Breitling <breitliw_at_centrexcc.com>
Date: Tue, 22 Jun 2004 04:40:53 -0600
Message-Id: <6.1.0.6.2.20040622043350.02cda618@pop.centrexcc.com>


Tip - Always use aliases in your sql and qualify all columns with the alias, even if you think the column name is unambiguous. It helps reading and understanding a query without having all the table definitions and avoids confusion - both for the human reader, and at times for Oracle.

I presume that cl_clcode is from client, as_clcode from assets_view, and pc_clcode from perfclient. Try completing the transitive closure and add the predicate
"AND pc_clcode = as_clcode" and see if that helps.

At 03:06 PM 6/21/2004, you wrote:
> > Hi all,
> > I have the following query which is running very slow as it takes few min=
>utes to complete.
> >=20
> > SELECT sum(nvl(as_ofcsh,0)),sum(nvl(as_offxd,0)),
> > sum(nvl(as_ofeqty,0)),sum(nvl(as_ofai,0))
> > FROM perfclient, assets_view, client
> > WHERE cl_decmkr=3D'64501013'
> > AND cl_clcode=3Das_clcode
> > AND as_date=3D '200312'
> > AND cl_clcode=3Dpc_clcode
> > AND pc_prfcomb in ('B', 'Y')
> > AND pc_grpdte !=3D '0000-00-00'
> > AND substr(pc_grpdte,1,4)||substr(pc_grpdte,6,2) <=3D '200312'
> >=20

regards

Wolfgang Breitling
Centrex Consulting Corporation
www.centrexcc.com



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Tue Jun 22 2004 - 05:53:01 CDT

Original text of this message

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