</code>
http://asktom.oracle.com/~tkyte/runstats.html <code>
benchmark it!
(but also ask, what cost is it to take them out. What if Oracle took out
v$ tables
timed statistics
sql_trace
all events
all diagnostic stuff
would Oracle run
a) faster
b) slower
???
I say "B, obviously". It would definitely be "B".
Without the diagnostic stuff, we would never get it running fast in the first place and we'd never be able to figure out what went wrong when it does.
Leave the debug in your procedure code so you can turn it on when necessary.
Here is some of my old production C code:
sprintf( plsql_block, "%s%s%s%s", BLOCK1, BLOCK2, BLOCK3, BLOCK4 );
debugf(( ctx, "length of pl/sql block is %d bytes", strlen(plsql_block)))
start = get_hsecs(ctx);
debugf(( ctx, "Attempting to describe '%s'", objname ))
if ( oparse(&ctx->cda, plsql_block, -1, 0, 2 )) die(ctx,oerr_cda(ctx));
debugf(( ctx, "describe pl/sql block parsed..." ))
if ( obndrv( &ctx->cda, "ObjectName", -1, objname, strlen(objname)+2,
STRING_TYPE, -1, 0, 0, -1, -1) ) die(ctx,oerr_cda(ctx));
debugf(( ctx, "Bound 'ObjectName'" ))
if ( obndrv( &ctx->cda, "AllNames", -1, AllNames, sizeof(AllNames),
STRING_TYPE, -1, &AllNamesI,0,-1,-1) ) die(ctx,oerr_cda(ctx));
debugf(( ctx, "Bound 'AllNames'" ))
if ( obndrv( &ctx->cda, "HasDefault", -1, HasDefault, sizeof(HasDefault),
STRING_TYPE, -1, &HasDefaultI,0,-1,-1) ) die(ctx,oerr_cda(ctx));
debugf(( ctx, "Bound 'HasDefault'" ))
if ( obndrv( &ctx->cda, "CountOfTables", -1, CountOfTables,
sizeof(CountOfTables), STRING_TYPE, -1, &CountOfTablesI,
0, -1, -1) ) die(ctx,oerr_cda(ctx));
debugf(( ctx, "Bound 'CountOfTables'" ))
if ( obndrv( &ctx->cda, "TableNames", -1, TableNames, sizeof(TableNames),
STRING_TYPE, -1, &TableNamesI,0,-1,-1)) die(ctx,oerr_cda(ctx));
debugf(( ctx, "Bound 'TableNames'" ))
if ( obndrv( &ctx->cda, "qualifiedObj", -1, qualifiedObj,
sizeof(qualifiedObj), STRING_TYPE, -1, &qualifiedObjI,0,-1,-1))
die(ctx,oerr_cda(ctx));
debugf(( ctx, "Bound 'qualifiedObj'" ))
Every other line -- debug, it never let me down :)