Re: Primary Key and Indexes, are they necessary?



jchen.com@xxxxxxxxx wrote:
We have an Oracle aplication (developed by a vendor) which has about
150 tables.
However there is no primary keys on any tables. There are only about 30
non-unique
indexes (some of them are added after we requested).
So enforcing data integrity in application. A nice way to create mess
in db. DB validates data integrity faster, db validates data integrity
more reliable. Using DB for just data waste isn't the best way to use
it.
Probably a good starting point
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:6091237036109
and one from these groups
http://groups.google.ca/group/comp.databases.theory/browse_frm/thread/609b28588c6c8a44/a449f62f434e26ea

The vendor responsed that the reasons they do not add the primary key
and nessary
indexes are:
1. The index will slow down the data entry
2. While adding primary keys can enhance performance in Oracle DB, it
can also degrade
performance.
Everything uses some resources. Oracle as such is a big waste of
resources. Why use Oracle. If they are soooooo worried about
performance why use Oracle. MySQL would be faster.

For example, if a code table contains fewer than 30
rows (not sure the exact
cut off), it is just as fast if not faster to do a full table scan
for the information you are looking
up. Especially, if the DB is not fragmented. Doing an indexed or
Primary key look-up in a
table of that size would cause jumping of the disk read/write head,
while a sequence read
can complete much faster.

See http://www.jlcomp.demon.co.uk/myths.html
look for Tables of only 1 or 2 blocks do not need indexing

And regarding your problems with reports. Firstly they should eliminate
some common problems like using RBO, which seems possible for such
"advanced people with 20 years of experience" and then tune each report
individually and watch out again for common problems. Reports usually
tend to use all data or most of the data in tables so probably RBO and
index access paths are slowing down them. Probably full scans with hash
joins would work better. Of course that's just a guess, but I'v
experienced that in my life with a person with much more experience
with Oracle than me ;)

Gints Plivna
http://www.gplivna.eu

.



Relevant Pages

  • Re: MSSQL - Invalid attribute/option identifier
    ... database import and some how it did created all the table and placed the ... data but all my primary keys, unique indexes, foregin keys, and relation ... problem while I am just trying to test if my code works with MSSQL. ... sProj is an Recordset created by MFC object (Originally from ORACLE ...
    (microsoft.public.vc.mfc)
  • odbc joint primary keys - allowing duplicate data?
    ... oracle won't let me add a duplicate record...as I would expect. ... The design view in Access shows 2 primary keys. ... Is this an ODBC issue and Access? ... can't have duplicate records being accepted.... ...
    (microsoft.public.data.odbc)
  • Indexing an Oracle Table
    ... I have an Oracle table that I am trying to query off of, ... There are no indexes or primary keys in this table, ... retrieve the information faster, meaning, how do I have the Oracle ...
    (microsoft.public.access.queries)
  • odbc -> oracle allowing duplicate entries?
    ... I am using Access as a front-end to an Oracle database so have ... The design view in Access shows 2 primary keys. ... Is this an ODBC issue and Access? ... can't have duplicate records being accepted.... ...
    (microsoft.public.data.odbc)
  • Re: Need advice - how should I set this up?
    ... I was confused with primary keys and foreign keys. ... have the combo autofill Otero, and hit tab to go on than to type ... A form based on a Grand Master Query That Includes Everything is ... generating Reports), but there is no benefit to doing so on a Form. ...
    (microsoft.public.access.tablesdbdesign)