DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: Indexes

  1. #1
    Join Date
    Jan 2001
    Posts
    642
    Hi,

    For any query on the tables have the indexes, can we explicitly make use of the index by saying
    table.rowid = index.rowid..
    For example
    select a.* from table_a a, index_b b
    where a.rowid = b.rowid;

    badrinath

  2. #2
    Join Date
    Oct 2000
    Location
    Saskatoon, SK, Canada
    Posts
    3,925
    Though oracle does the indexing through the table's rowid, I don't think that oracle had thought about this type of comparison.

    Sam
    Thanx
    Sam



    Life is a journey, not a destination!


  3. #3
    Join Date
    Feb 2001
    Posts
    389
    You cannot use a index like this in the query.Index rowid do not match with table rowid, instead the key values stored in index point to the rowid of the table data.

  4. #4
    Join Date
    Jan 2001
    Posts
    642
    I was under the impression that the indexes store the rowid that is same as the table row's rowid. Isn't it correct?

  5. #5
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Yes, this is correct, howevere you can't address index entries directly in any way. So you can't reference rowids stored in index, you can only reference table row by its rowid. Indexes can't be referenced in queries or DMLs, they are only available to optimizer if it chooses to use them. In queries you can only reference tables, views, snapshots, etc..., but not indexes!
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  6. #6
    Join Date
    Jan 2001
    Posts
    642
    That's very clear.
    I have another question,
    Having an index on the table slows down the 'insert' on that table. Does indexes have any bearing on 'delete' operation on the table.(Would it make the deletion from the table, slower)


    Badrinath


  7. #7
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Yes, although the owerhead during deletes is slightly lower than during the inserts....
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  8. #8
    Join Date
    Feb 2001
    Posts
    295
    Yes. Every time you use a DML statement (INSERT, DELETE, UPDATE), indexes have to be updated too. That's why it's not recommended to have many indexes in tables that are constantly updated.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width