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

Home -> Community -> Usenet -> c.d.o.server -> Re: tkprof questions

Re: tkprof questions

From: Kjetil Skotheim <kjetilskotheim_at_iname.com>
Date: Fri, 25 Aug 2000 22:18:03 +0200
Message-ID: <39A6E28B.69C1752D@iname.com>

Vik wrote:
>
> 1. If I run:
>
> TKPROF x.trc ora x.txt SORT = exeela PRINT = 10

Why the "ora " ?  

> shouldnt that give me the 10 most expensive queries in terms
> of time to execute?

Yes, I should think so.  

> 2. How do I get tkprof to aggregate queries that are repeated with
> a different parameter? like:
> select id from foo where name = a
> select id from foo where name = b

Best guess from someone will limited experience with tkprof:

The problem is that you're not using bind variables! Using bind variables will also make your queries faster because then oracle will already have parsed the query, and the "parametrisized" query will turn up only once i tkprof: Typically, use: select avg(age) from emp where dept=:1;
(One query in tkprof)
Then bind 'SALES' and 'STORE' to :1 insted of using: select avg(age) from emp where dept='SALES'; select avg(age) from emp where dept='STORE'; (...witch will become two queries in tkprof).

-- 
Kjetil Skotheim
kjetilskotheim_at_iname.com
Received on Fri Aug 25 2000 - 15:18:03 CDT

Original text of this message

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