0% found this document useful (0 votes)
69 views2 pages

Performance Enhancement Guidelines For PL

Here are the key guidelines for optimizing PL/SQL performance in 3 sentences or less: Use indexing and predicates to make queries more selective, avoid functions on the right side of queries, and use EXISTS over NOT IN. Prefer indexed columns in WHERE clauses and avoid full table scans by forcing index scans where possible. Some additional tips include using UNION ALL over UNION, TOP to limit excessive data returns, and hints to override the optimizer when confident it will improve performance.

Uploaded by

indrani009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views2 pages

Performance Enhancement Guidelines For PL

Here are the key guidelines for optimizing PL/SQL performance in 3 sentences or less: Use indexing and predicates to make queries more selective, avoid functions on the right side of queries, and use EXISTS over NOT IN. Prefer indexed columns in WHERE clauses and avoid full table scans by forcing index scans where possible. Some additional tips include using UNION ALL over UNION, TOP to limit excessive data returns, and hints to override the optimizer when confident it will improve performance.

Uploaded by

indrani009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Performance Enhancement Guidelines for PL/SQL

Avoid usage of Union and select Distinct in your


queries .Replace them by Union All and OR.
Use the top operator to prevent excessive data return if
requirements allow
When you have choice use Where clause in the following
order of preference
. ! " !
#. !$%
&. !$"%
'. !("%
). !(%
*n a where clause search criteria at least
one highly selective column must be used
which is indexed. *f not available consider
using a covering index for the column.
Avoid +ql +tatements that are not
searchable by the query optimi,er .-he
following should be avoided *. A W/0R0
12AU+0 with innovative thin3ing.-his is
given in decreasing order of preference.
. *+ .ull
#. ($
&. .O-
'. .O- 04*+-+
). .O- *.
5. .O- 2*60
Example:
.O- *. can be replaced by proper use of exists
Don%t use functions on the right hand side of a query.
Avoid usage of +U7+-R*.8+
Use hints in your query if confident of overriding 9uery Optimi,er rules.
Don%t return redundant column data
/ere are the 3ey operands used in the W/0R0 clause: ordered by their
performance. -hose operands at the top will produce results faster than those
listed at the bottom.
. A single literal used by itself on one side of an operator
#. A single column name used by itself on one side of an operator: a
single parameter used by itself on one side of an operator
&. A multi;operand expression on one side of an operator
'. A single exact number on one side of an operator
). Other numeric number <other than exact=: date and time
5. 1haracter data: .U22s
When given a choice between *. And 0xists Use 0xists
*f the table is giving full scans then try to force index scan
if possible
Example
+0201- > ?RO@ tbl-as3Arocesses W/0R0 nextprocess "
A.D processid *. <B:&#:')=
ta3es about & seconds: whileC
+0201- > ?RO@ tbl-as3Arocesses <*.D04 " *4DArocess*D=
W/0R0 nextprocess " A.D processid *. <B:&#:')=
returns in under a second
When given a choice of usage of *. and 70-W00. use 70-W00.
Avoid using +tring concatenation in statements
And Operation usage
When using and try to use the condition that is
supposed to retrieve least noC of rows or which is least
li3ely to occur.
*f both the quries are equally li3ely then use the simpler
expression first
*f a column is supposed to be sorted often then use a clustered index on that
column.
@a3e use of rowid to update andEor select from a query as far as
situations allow.

You might also like