Thanks Tim.  I think I will always consider my tuning skills basic until I
can at least get to the point that when someone mentions a buzzword
(waits,ratios,tkprof,latches,fetches,etc.) I will be able to recall to
memory a unhazy idea of the concept they are referring to instead of
rummaging through all my notes and books (although I think I pretty
efficient at that).

Anyway, answers to some of your inquiries.  It is a two-tier application
where every user session spawns a
corresponding database session.  Here are the results of the TKPROF (wow,
the sql I was questioning is at the top of the rpoert):

TKPROF: Release 8.1.7.0.0 - Production on Thu Feb 27 09:09:35 2003

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

Trace file: ora02148.trc
Sort options: prsela  exeela  fchela  
****************************************************************************
****
count    = number of times OCI procedure was executed
cpu      = cpu time in seconds executing 
elapsed  = elapsed time in seconds executing
disk     = number of physical reads of buffers from disk
query    = number of buffers gotten for consistent read
current  = number of buffers gotten in current mode (usually for update)
rows     = number of rows processed by the fetch or execute call
****************************************************************************
****

SELECT PARENTID FROM PROC_
WHERE PROCEDUREID=:1

call     count       cpu    elapsed       disk      query    current
rows
------- ------  -------- ---------- ---------- ---------- ----------
----------
Parse        2      0.00       0.00          0          0          0
0
Execute   1696      0.36       0.75          0          0          0
0
Fetch     1696      0.11       0.14          0       5136          0
1696
------- ------  -------- ---------- ---------- ---------- ----------
----------
total     3394      0.47       0.89          0       5136          0
1696

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Parsing user id: 19  (WINSPC)

Rows     Execution Plan
-------  ---------------------------------------------------
      0  SELECT STATEMENT   GOAL: CHOOSE
      0   TABLE ACCESS   GOAL: ANALYZED (BY INDEX ROWID) OF 'PROC_'
      0    INDEX   GOAL: ANALYZED (UNIQUE SCAN) OF 'PROC_KEY' (UNIQUE)

****************************************************************************
****



Thanks,
Jeff

-----Original Message-----
Sent: Wednesday, February 26, 2003 6:19 PM
To: Multiple recipients of list ORACLE-L


Jeff,

Comments inline...

> So my boss comes over this morning and tells me that the users are having
a
> performance problem with a 3rd party application that have recently began
> using.  This is an oracle database where they bought the software and had
> the system admin install the software which included the vendors
instruction
> of creating and setting up the database (basically use the defaults).  It
is
> an Oracle 8.1.7 database on Windows 2000.  He wants me to find out "if you
> can create some indexes or something", etc. (he likes to give solutions
> before the cause if discovered).

Good observation about your boss -- never forget it!

> Anyway,  I decide to take a look at it.  The performance they are
> complaining about is when they log into the application it takes about a
> minute for their initial screen (which includes a list of values) to
appear.
> I use the tool that someone posted here a while ago, SQL Monitor from
> www.fastalgo.com, and find that during the time the user is waiting for
the
> first screen the application is executing a sql statement about 2200
times.

Excellent technique.  Never used the tool, but you are responding to the
facts and symptoms, not conjecture and guesses...

> The SQL is:  SELECT PARENTID FROM PROC_  WHERE PROCEDUREID=:1
> The bind variable is different for each execution with appears to be the
> procedureid values from the table proc_.  Table proc_ has 2203 rows.
> I check the executions for the sql text in v$sqlarea.  Executions =
58,825.
> (aha, I think this is the problem).
> I explain plan the query and find that it is using the primary key index.
>
> My tuning skills are still pretty basic.  Since I have no control over the
> application is there anything I can do to increase the performance of
> running the query thousands of times?

Your tuning skills are not basic.  You know enough to look before assuming
and you appear to know your way around an Oracle database.

It is not easy to tune something that is executing thousands of times,
except to work on reducing the cost per execution.  How many "logical reads"
is each execution performing?  Or, at least how many logical reads are
performed in total and what is the number of executions?

I have posted an Oracle8i AFTER LOGON database-event trigger in a script
named "tracetrg.sql" at http://www.EvDBT.com/tools.htm.  You can use that
trigger to initiate SQL Tracing immediately upon connection by the user.
Are you familiar with SQL Trace and TKPROF?  Hopefully, the parameter
TIMED_STATISTICS is set to TRUE in this database;  if it isn't, you can
enable it in the TRACETRG trigger for the session (i.e. "execute immediate
'alter session set timed_statistics = true';") or using ALTER SYSTEM to set
it to TRUE for the instance.  If you can set TIMED_STATISTICS to TRUE, then
please use the "sort=prsela,exeela,fchela" clause with the TKPROF command;
if it is FALSE, then please use "sort=exeqry,execu,fchqry,fchcu" clause.
This way, the worst SQL statements will percolate to the top of the TKPROF
report...

If you can get a TKPROF report, would you like to paste the relevant section
for the offending SQL statement back to the list?  That way, you'll get lots
of ideas from the best tuning folks in the world.

And don't forget to DISABLE or DROP that trigger when you've gotten your
trace!  Coming from personal experience, it is *VERY* embarrassing to have
to explain why the file-system housing the USER_DUMP_DEST keeps filling
up... :-(

> Also how do you usually deal with 3rd party application issues like this?
> 95% of our databases/applications are from 3rd party vendors and it's a
pain
> trying to get them performing better.

We never have "control" over the application and it is always a pain.
However, don't neglect the possibility that the application is somehow
misconfigured or configured inappropriately somehow.  It's not easy to ask
questions about this without triggering the knee-jerk "No!  Everything's
fine!" response, but is it reasonable that an application session would need
to perform those several-thousand queries at each login?  Is it a two-tier
(a.k.a. "client-server") application where every user session spawns a
corresponding database session, or is it an N-tier application where the
app-server is creating a "pool" of database connections.  A huge up-front
load like you describe is more characteristic of the N-tier app-server, and
less characteristic of "client-server" connections.  Just some food for
thought...

> Thanks,
> Jeff Eberhard

Good luck!

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Tim Gorman
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Eberhard, Jeff
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to