Posts

Showing posts from May, 2015

Dont let RI degrade your DB performance

Image
Don't Let Referential Integrity Degrade Your Database Performance Foreign key (FK) constraints without supporting indexes can cause severe performance problems during SQL queries and massive DML (Data Manipulation Language) operations, such as DELETEs or UPDATEs. Use a SQL script to detect unindexed foreign key constraints. by Boris Milrud, Oracle Pro - See more at: http://www.devx.com/getHelpOn/10MinuteSolution/16595#sthash.KTEjQBxn.dpuf O racle databases provide a powerful mechanism for enforcing business rules, called referential integrity (RI), which is implemented either via a declaration of foreign key (FK) constraints ("declarative RI") or via triggers. It is almost impossible to find an Oracle database with no declarative RI implemented. Declarative RI protects the integrity of related data by defining the relation between data in different tables. Relation between two tables is defined using a combination of primary, or unique, key (PK) and FK constr

Primary Key

--------------------------------------------------------------------------- drop table dept Error report - SQL Error: ORA-02449: unique/primary keys in table referenced by foreign keys 02449. 00000 -  "unique/primary keys in table referenced by foreign keys" *Cause:    An attempt was made to drop a table with unique or            primary keys referenced by foreign keys in another table. *Action:   Before performing the above operations the table, drop the            foreign key constraints in other tables. You can see what            constraints are referencing a table by issuing the following            command:            SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = "tabnam"; -----------------------------------------------------------------------

Index

This article is about understanding Index in Oracle database but should be applicable for any other RDBMS database Understanding Index Submitted by rleishman on Sun, 2007-02-04 04:06 Of iPods and Indexes I'm not really an "early-adopter" of technology. Don't get me wrong; I love it, I just don't want to feed the addiction. When I  do  get a new piece of technology though, it's like a fever; I can't concentrate on  anything  until I've read the manual from cover to cover and found out everything it can do, every built-in gizmo, and every trashy piece of after-market merchandise that can be plugged into it. And I don't think I'm alone here. Working in I.T., there's no shortage of people who can peel off a half-hour litany on their new Blackberry/IPod/Notepad/Digital Watch within a day of purchase. So why are databases different? I worked with Oracle databases for 5 years before I understood indexes - and it's right there in