Advanced PL/SQL Programming: Indexes and Performance Optimization in Oracle 10g
Explore the nuances of advanced PL/SQL programming, focusing on indexing and performance enhancement techniques in Oracle 10g. Learn about the implications of indexes on SELECT, INSERT, UPDATE, and DELETE operations, and understand why not every table should be indexed. Discover how functions and cursor-for-loops can simplify coding practices, enhancing efficiency without the complexity of traditional cursor management. This guide is essential for optimizing database performance while maintaining manageable code.
Advanced PL/SQL Programming: Indexes and Performance Optimization in Oracle 10g
E N D
Presentation Transcript
Agenda • Indexes • Not PL/SQL but a RBMS performance enhancement • PL/SQL • Functions • Cursor For Loops
Indexes Table Table Index on Color Impacts on:SELECT? INSERT? UPDATE? DELETE? Database object which provides capability to speed up the search process. Guide to Oracle 10g
Indexes in SQL Guide to Oracle 10g
Why not Index Everything? Every Index makes one of those “index tables” If you have 10 indexes on a table, an INSERT, DELETE or UPDATE needs to write to that table + the 10 index tables. Indexing speeds up reads at the expense of writes. Guide to Oracle 10g
Functions Functions are stored procedures which return a value. Functions are not executed like stored procedures. Instead, they are called from within SQL or PL/SQL. SELECT myfunction() … Guide to Oracle 10g
Functions Guide to Oracle 10g
Cursor For Loops Easier to implement cursors. Simplified – no open, close, fetch or exit conditions! If you need to use a cursor, use these. Guide to Oracle 10g