Indexing vs. no indexing when inserting records

Posted by jbu on Stack Overflow See other posts from Stack Overflow or by jbu
Published on 2008-10-27T22:51:49Z Indexed on 2010/06/06 20:12 UTC
Read the original article Hit count: 608

Filed under:
|
|

I have a few questions about whether or not it would be best to not use indexing.

BACKGROUND: My records have a timestamp attribute, and the records will be inserted in order of their timestamps (i.e., inserted chronologically).

QUESTIONS:

  1. If I DON'T use indexing is it typical for the database to insert the records in the order that they were inserted?

  2. If answer to #1 is yes, when I do a "SELECT .. WHERE timestamp > X" type query will the database be efficient at it, or will it have to go through every single record since it isn't indexed? I would assume if there were no index, the database would not "know" that the records were inserted in sorted order and could not, therefore, make use of sorted property of the database.

I assume a clustered index would be best for these types of records & their inserts.

Please let me know what you guys think.

Thanks, jbu

© Stack Overflow or respective owner

Related posts about database

Related posts about sorting