Database performance and tuning

By:Subhash Hegde

June 27th 2009

1

Market proposition
  

$25 Billion/120,000 Crore industry Oracle leads the market share Unix/Linux lead the market as the hosting operating system

June 27th 2009

Karthavya technologies

2

Market share
15% 1% 44% 20% Oracle IBM-DB2 Microsoft-Sql server Mysql Others 20%

June 27th 2009

3

Hosting operating system
7% Unix/Linux Windows Mainframe Others

8%

45%

40%

June 27th 2009

4

Oracle architecture
Control File

Redo Log Buffer

Bufer Cache

Shared Pool

Datafile Redo Log init.ora Archived log file Password File

DBWR

LGWR SGA

LCKO

Alert log file Trace files

Instance
June 27th 2009

Database
5

Tuning methodology- Road map
     

Tuning Tuning Tuning Tuning Tuning Tuning

business rules Database design database operations I/O and memory allocation resource contention the underlying platform
6

June 27th 2009

Database indexing- How it works
 

B tree structure Oracle decides to use index or table scan depending on its calculations.

June 27th 2009

7

Example: Performance boost achieved by indexing
  

Search without index Search with index Performance comparison against a index on a column with less cardinality Tools used to verify query performance – sqlplus autotrace utility, sql developer etc.
8

June 27th 2009

Database indexing (cntd..) Best practices
  

Index columns having maximum cardinality Limit the number of indexes on each table Create an index if you frequently want to retrieve less than 15% of the rows To improve performance on joins of multiple tables, index columns used for joins. The order of columns in the CREATE INDEX statement can affect query performance. In general, specify the most frequently used columns first. Drop indexes on a table before migration
9

June 27th 2009

Prepared statements

 

Can help increase security by separating SQL logic from the data being supplied Pre-prepares execution plan Not recommended for rarely used inserts. Hibernate uses prepared statements

June 27th 2009

10

Buzzwords / applications
     

RBO (Rule based optimizer) CBO (Cost based optimizer) Enterprise manager RMAN (Recovery manager) Schema Tablespace

June 27th 2009

11

Case study- BLIS
Issues faced and action taken

BLIS database contains approximately 27 Lakh records Initial approach to attain search speed failed Database went down because of issues like row lock and index failures Data backup method
12

June 27th 2009

Questions?

June 27th 2009

13

Sign up to vote on this title
UsefulNot useful