Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6533293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:06:28+00:00 2026-05-25T10:06:28+00:00

I have a table with 120 columns. It has 8 indexes on it (1

  • 0

I have a table with 120 columns. It has 8 indexes on it (1 clustered, 7 non-clustered). As a test, I inserted 3,400 rows into the table and it took an average of 12 seconds.

I created the same table with a different name and created 32 additional indexes on it (total 40 indexes) and again insert same 3,400 rows it took an average of 13.5 seconds.

I read before when an index is created, a copy of the table is created and sorted by that column that participates in the index.

I have 2 questions:

1) Is it true that for every index a copy of the table is created?

2) 32 indexes add only 1.5 seconds for the same INSERT command. Does this average remain for 10,000 rows? or for 80 indexes?


I have another question:

3)when we have a Foreign key on a column SQL Server automatically create non-cluster index on it.When we have a forein key on a column If we create a non-cluster index on it,is this Index useful for quering or Joins?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:06:28+00:00Added an answer on May 25, 2026 at 10:06 am

    1) op asks: Is it true that by every index a copy of table created? it is not true. an index will store the indexed columns and the pointer back (like the the clustered PK, etc.) to the row. it will also store any INCLUDE columns, but that is another topic.

    2) it is hard to guess on the timings not knowing the hardware, the tables, or the indexes in question. I’m sure that SQL Server is good at optimizing the maintenance of indexes. You should test this by inserting the same rows with only a PK and then try again with 40 indexes and then again with 80. I’m sure the bulk of the time is just the inserts.

    EDIT

    3) op asks when we have a Foreign key on a column SQL Server automatically create non-cluster index on it.this Index useful for quering or Joins? SQL Server does NOT automatically create an index for foreign keys. However, adding an index on FK columns may be useful. If you write a query that joins two tables on the FK, then the index MAY be used. Consider the following:

    tableA
    RowID    int PK
    RowDate  datetime
    OtherID  int
    
    tableB
    OtherID  int PK
    someValue varchar(5)
    

    if you add a FK for tableA.OtherID to tbaleB.OtherID and use this query:

    select * from tableA a INNER JOIN tableB b ON a.OtherID=b.OtherID
    WHERE a.RowDate<'2011/1/1'
    

    then an index on tableA.OtherID won’t be used, an index on tableA.RowDate will be used and the PK index on tableB.OtherID will be used.

    select * from tableA a INNER JOIN tableB b ON a.OtherID=b.OtherID 
    WHERE b.someValue='AA'
    
    could also be written as:
    
    select * from tableb b INNER JOIN tableA b ON b.OtherID=a.OtherID 
    WHERE b.someValue='AA'
    

    then an index on tableA.OtherID may be used, and any index on tableb.someValue will be used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table inside a div tab. The table has 40 rows in it
I have a mySQL table called test: create table test( locationExpect varchar(120) NOT NULL;
I have table rows of data in html being filled from a CGI application.
I have table with 3 columns A B C. I want to select *
I have table in data base name train delay, with columns train number(int), DelayTime(int),
I have table A in Oracle that has a primary key (id). I need
I have a very large database with about 120 Million records in one table.I
I have a table with three columns: patient_id obs_date weight_val patient_id stores patient identification
I have a Table with 4 columns inside a FlowDocument. I've set the width
I have a table in MySQL that have a few columns that have default

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.