Advertisement

08.21.2007 at 09:09AM PDT, ID: 22777125
[x]
Attachment Details

performance of query

Asked by suhinrasheed in Oracle 9.x, PL / SQL

Hi,

This is the query which is running slow:it used to run quickly till yesterday.Yesterday overnight there was an entire statistics collection of the database..did that cause the problem..how can i fix

If i remove the subselect (higlighted part) and then run the remaining quer it runs fast,even if run the subquery alone it also runs quickly

select project2_.PG_PG_ID as col_0_0_,
       project2_.TC_CODE as col_1_0_,
       projectgro7_.GROUP_NAME as col_2_0_,
       count(distinct relationsh0_.CO_CO_ID) as col_3_0_
 from RELATIONSHIPS relationsh0_
    , PROJECT_COST_CENTRES projectcos1_
    , PROJECTS project2_
    , PROJECT_GROUPS projectgro7_
where nvl(relationsh0_.deleted, 'N') = 'N'
 AND ( SELECT vra.readonly
       FROM v_relationship_access vra
       WHERE vra.email_address = lower ('mark.conboy@db.com')
       AND vra.rel_rel_id = relationsh0_.rel_id
     ) in ('Y', 'N')
 and project2_.PG_PG_ID=projectgro7_.PG_ID
 and projectcos1_.PRO_PRO_ID=project2_.PRO_ID
 and relationsh0_.PCC_PCC_ID=projectcos1_.PCC_ID
group by project2_.PG_PG_ID
       , project2_.TC_CODE
       , projectgro7_.GROUP_NAME
having count(relationsh0_.CO_CO_ID) >0
order by project2_.TC_CODE desc
       , projectgro7_.GROUP_NAME


The script for view v_relationship_access is :

CREATE OR REPLACE VIEW VDB_OWNER.V_RELATIONSHIP_ACCESS
(EMAIL_ADDRESS, CO_ID, REL_REL_ID, READONLY)
AS
SELECT email_address
     , co_id
     , rel_rel_id
     , readonly
FROM  RELATIONSHIP_ACCESS;

and i have indexes on RELATIONSHIP_ACCESS TABLE for email_address and rel_rel_id


CREATE UNIQUE INDEX RELA_PK ON RELATIONSHIP_ACCESS
(EMAIL_ADDRESS, CO_ID, REL_REL_ID)
LOGGING
TABLESPACE VDB_INDX01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          1M
            MINEXTENTS       1
            MAXEXTENTS       2147483645
            PCTINCREASE      0
            FREELISTS        1
            FREELIST GROUPS  1
            BUFFER_POOL      DEFAULT
           )
NOPARALLEL;


CREATE INDEX RELA_REL_FK ON RELATIONSHIP_ACCESS
(REL_REL_ID)
LOGGING
TABLESPACE VDB_INDX01
PCTFREE    10
INITRANS   2
MAXTRANS   255
STORAGE    (
            INITIAL          1M
            MINEXTENTS       1
            MAXEXTENTS       2147483645
            PCTINCREASE      0
            FREELISTS        1
            FREELIST GROUPS  1
            BUFFER_POOL      DEFAULT
           )
NOPARALLEL;
Start Free Trial
[+][-]08.21.2007 at 09:52AM PDT, ID: 19739463

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.21.2007 at 10:09AM PDT, ID: 19739619

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.21.2007 at 12:21PM PDT, ID: 19740705

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.21.2007 at 04:20PM PDT, ID: 19742508

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Oracle 9.x, PL / SQL
Sign Up Now!
Solution Provided By: StephenCairns
Participating Experts: 4
Solution Grade: B
 
 
[+][-]08.22.2007 at 12:28AM PDT, ID: 19744183

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.22.2007 at 05:29AM PDT, ID: 19745432

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.22.2007 at 09:22AM PDT, ID: 19747576

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.22.2007 at 09:49AM PDT, ID: 19747780

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.23.2007 at 05:19PM PDT, ID: 19758906

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628