Skip Headers

Oracle9i Supplied PL/SQL Packages and Types Reference
Release 2 (9.2)

Part Number A96612-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

DBMS_ODCI, 2 of 2


Summary of DBMS_ODCI Subprograms

Table 35-1 DBMS_ODCI Subprograms
Subprogram Description

ESTIMATE_CPU_UNITS Function

Returns the approximate number of CPU instructions (in thousands) corresponding to a specified time interval (in seconds).

ESTIMATE_CPU_UNITS Function

ESTIMATE_CPU_UNITS returns the approximate number of CPU instructions (in thousands) corresponding to a specified time interval (in seconds). This information can be used to associate the CPU cost with a user-defined function for the extensible optimizer.

The function takes as input the elapsed time of the user function, measures CPU units by multiplying the elapsed time by the processor speed of the machine, and returns the approximate number of CPU instructions that should be associated with the user function. (For a multiprocessor machine, ESTIMATE_CPU_UNITS considers the speed of a single processor.)

Syntax

DBMS_ODCI.ESTIMATE_CPU_UNITS (
   elapsed_time NUMBER) 
RETURN NUMBER;

Parameters

Table 35-2 ESTIMATE_CPU_UNITS Function Parameters
Parameter Description

elapsed_time

The elapsed time in seconds to execute the function

Usage Notes

When associating CPU cost with a user-defined function, use the full number of CPU units rather than the number of thousands of CPU units returned by ESTIMATE_CPU_UNITS. In other words, multiply the number returned by ESTIMATE_CPU_UNITS by 1000.

Example

To determine the number of CPU units used for a function that takes 10 seconds on a machine:

DECLARE 
  a INTEGER;
BEGIN 
  a := DBMS_ODCI.ESTIMATE_CPU_UNITS(10);
  DBMS_OUTPUT.PUT_LINE('CPU units = '|| a*1000);
END;

Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2000, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback