Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Slow running Query.
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
-- 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
![]() |
![]() |