Edi Yanto (何 萬 新)

Posts Tagged ‘performance

Oracle Top-N Query

Posted by: Edi Yanto on: October 1, 2009

Using RANK function, with a faster execution plan (WINDOW SORT PUSHED RANK) SELECT Empno, Ename, Job, Mgr, Hiredate, Sal FROM (SELECT Empno, Ename, Job, Mgr, Hiredate, Sal, RANK() OVER (ORDER BY SAL Desc) AS Emp_Rank FROM Emp) WHERE Emp_Rank <= 5; Using row_number function (speed up top-n queries) SELECT Empno, Ename, Job, Mgr, Hiredate, Sal [...]

Cause: Failed to allocate an extent of the required number of blocks for a temporary segment in the tablespace indicated. Action: Use ALTER TABLESPACE ADD DATAFILE statement to add one or more files to the tablespace indicated. MetaLink has a very detailed and informative article concerning ORA-01652 and RAC.  There is some troubleshooting required with [...]

Operations such as upgrades, patches and DDL changes can invalidate schema objects.  For this reason it makes sense to recompile invalid objects in advance of user calls. It also allows you to identify if any changes have broken your code base. In order to compile a program, you must own that program (in other words, [...]

PL/SQL sends SQL statements such as DML and queries to the SQL engine for execution, and SQL returns the result data to PL/SQL. You can minimize the performance overhead of this communication between PL/SQL and SQL by using the PL/SQL language features known collectively as bulk SQL. The FORALL statement sends INSERT, UPDATE, or DELETE [...]

Dynamic SQL with RETURNING BULK COLLECT INTO Clause

Posted by: Edi Yanto on: May 25, 2007

Only INSERT, UPDATE, and DELETE statements can have output bind variables. You bulk-bind them with the RETURNING BULK COLLECT INTO clause of EXECUTE IMMEDIATE. With this clause, you can see which data have been inserted, updated or deleted.

Dynamic SQL with BULK COLLECT INTO Clause

Posted by: Edi Yanto on: May 25, 2007

Bulk SQL passes entire collections back and forth, not just individual elements. This technique improves performance by minimizing the number of context switches between the PL/SQL and SQL engines. You can use a single statement instead of aloop that issues a SQL statement in every iteration. Bulk binding lets Oracle bind a variable in a [...]

Assigning Nested Tables with Set Operators

Posted by: Edi Yanto on: May 16, 2007

The SQL language has long offered the ability to apply set operations (UNION, INTERSECT, and MINUS) to the result sets of queries. In Oracle Database 10g, you can now use those same high-level, very powerful operators against nested tables (and only nested tables) in your PL/SQL programs and on nested tables declared as columns inside [...]

Possible Exceptions for Collection Assignments

Posted by: Edi Yanto on: May 15, 2007

Assigning a value to a collection element can cause various exceptions: If the subscript is null or is not convertible to the right datatype, PL/SQL raises the predefined exception VALUE_ERROR. Usually, the subscript must be an integer. Associative arrays can also be declared to have VARCHAR2 subscripts. If the subscript refers to an uninitialized element, [...]

Exit Early from Nested FOR Loop

Posted by: Edi Yanto on: May 14, 2007

If you want to exit from any enclosing loop, but not just the current loop, you can label the enclosing loop and use the label in an EXIT statement. <<outer>> FOR i IN 1..5 LOOP . . . . . FOR j IN 1..10 LOOP . . . . . EXIT outer WHEN . . [...]

NOCOPY is a hint to the compiler about how you would like the PL/SQL engine to work with the data structure being passed in as an OUT or IN OUT parameter. By default, OUT and IN OUT parameters are passed by value. The values of any IN OUT parameters are copied before the subprogram is [...]


RSS Syndication


Edi Yanto
Oracle Applications Technical Consultant
View Edi Yanto's profile on LinkedIn

My Certifications




Enter your email address to follow this blog and receive notifications of new posts by email.

Join 992 other followers

Archives

 

June 2012
M T W T F S S
« May    
 123
45678910
11121314151617
18192021222324
252627282930  

Top Rated

RSS Unknown Feed

  • An error has occurred; the feed is probably down. Try again later.

Visitors

Categories

Blog Stats

  • 54,082 hits

Users Online

web counter

Pages

Follow

Get every new post delivered to your Inbox.

Join 992 other followers