SQL Server Performance

When should you create an Index

Discussion in 'General DBA Questions' started by jstevenson, Dec 26, 2009.

  1. jstevenson New Member

    I have a SP that builds a table and inserts data elements into that table. I would like to place an index on the table created by the SP. Should I create the index before data elements are inserted or after?
  2. Luis Martin Moderator

    After.
    Of course depends, but in general is faster to insert data without indexes.
    Could you development what happens with that table after inserts and how it is used?
  3. Jack Vamvas Member

    As a rule , after the data insert, but this will depend on : how often you do the build , how much data etc
  4. jstevenson New Member

    The table is being build for reporting purpose. It's being build every two hours due to business requirements. The total rowcount is approx 60,000. The total column is 10.
  5. rohit2900 Member

    is it something which will refresh the table data every 2 hours or is it something where you'll insert 60K records every two hours... for the first one it will be good if you drop the indexes, insert the data and put it back but nobody should be using this table till this activity completes. and for the later one if will be good if you plan your index fill factors accordingly as it might be more time & resource consuming to drop & create once the table has grown large.

Share This Page