Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Slow Query
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
hgha  
View profile  
 More options Jun 1 2007, 5:26 pm
Newsgroups: comp.databases.oracle.server
From: hgha <hou...@globe-tekcorp.com>
Date: Fri, 01 Jun 2007 14:26:19 -0700
Local: Fri, Jun 1 2007 5:26 pm
Subject: Slow Query
Hello,

The following query is performing poorly in the app. I have tried the
scalar subquery approach (using formatted to_char)  with no luck. any
help would be appreciated.

SELECT  MP_NO, MP_DESC, MP_ACTIVE AS "FLAG_YES_NO",
(
  ( SELECT COUNT(*)     FROM ST, STINV
                WHERE ST.ST_ID = STINV.ST_ID
                AND ST.ST_POSTED IS NOT NULL
                AND STINV.MP_NO = MPT.MP_NO )
   +
  ( SELECT COUNT(*) FROM PT, PTINV
                  WHERE PT.PT_ID = PTINV.PT_ID
                  AND PT.PT_POSTED IS NOT NULL
                  AND PTINV.MP_NO = MPT.MP_NO  )
)
FROM MPT
WHERE COMP_ID = 1
GROUP BY MP_NO, MP_DESC, MP_ACTIVE

Thanks,


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
DA Morgan  
View profile  
 More options Jun 1 2007, 6:40 pm
Newsgroups: comp.databases.oracle.server
From: DA Morgan <damor...@psoug.org>
Date: Fri, 01 Jun 2007 15:40:27 -0700
Local: Fri, Jun 1 2007 6:40 pm
Subject: Re: Slow Query

To help you we need the following:
1. DDL for column data types
2. Oracle version number to three decimal places
3. Explain Plan creating using DBMS_XPLAN not a legacy script
4. A definition of "poorly" specifically referencing your SLA
--
Daniel A. Morgan
University of Washington
damor...@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles Hooper  
View profile  
 More options Jun 1 2007, 10:44 pm
Newsgroups: comp.databases.oracle.server
From: Charles Hooper <hooperc2...@yahoo.com>
Date: Fri, 01 Jun 2007 19:44:46 -0700
Local: Fri, Jun 1 2007 10:44 pm
Subject: Re: Slow Query
On Jun 1, 5:26 pm, hgha <hou...@globe-tekcorp.com> wrote:

In addition to Daniel Morgan's request for specific information, it
might be interesting to see how the performance and DBMS_XPLAN of your
SQL statement compares with the following:
SELECT
  MPT.MP_NO,
  MPT.MP_DESC,
  MPT.MP_ACTIVE "FLAG_YES_NO",
  NVL(S.V1,0) + NVL(P.V2,0)
FROM
  MPT,
  (SELECT
    STINV.MP_NO,
    COUNT(*) V1
  FROM
    ST,
    STINV
  WHERE
    ST.ST_ID = STINV.ST_ID
    AND ST.ST_POSTED IS NOT NULL
  GROUP BY
    STINV.MP_NO) S,
  (SELECT
    PTINV.MP_NO,
    COUNT(*) V2
  FROM
    PT,
    PTINV
  WHERE
    PT.PT_ID = PTINV.PT_ID
    AND PT.PT_POSTED IS NOT NULL
  GROUP BY
    PTINV.MP_NO) P
WHERE
  MPT.COMP_ID=1
  AND MPT.MP_NO=S.MP_NO(+)
  AND MPT.MP_NO=P.MP_NO(+)
GROUP BY
  MPT.MP_NO,
  MPT.MP_DESC,
  MPT.MP_ACTIVE;

If possible, the outer join [ (+) ] should be removed from the SQL
statement that I posted above.

Is MPT.COMP_ID a column defined as NUMBER?

Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hgha  
View profile  
 More options Jun 5 2007, 3:37 pm
Newsgroups: comp.databases.oracle.server
From: hgha <hou...@globe-tekcorp.com>
Date: Tue, 05 Jun 2007 12:37:53 -0700
Local: Tues, Jun 5 2007 3:37 pm
Subject: Re: Slow Query
On Jun 1, 10:44 pm, Charles Hooper <hooperc2...@yahoo.com> wrote:

Thank you Charles. Your query works much faster.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »