performance tuning puzzle

  • I'm a total newbie at performance tuning. I generated a table with 3 million integers (1,2,3,4,5,6....) and no index. I wanted to see how long it would take a select statement to find the record were "index value = 3,000,000." I figured a table scan of three million records would take some time. It did -- less than one second! There's no point adding an index to this table to improve performance.

    OK, so how do I generate a table with a performance "probem" where an index can clearly improve things?

    *Dumb*foundedly Your,

    Bill

  • Hi add a varchar field with different values and use a where clause to search a record. Also a join with a new table is bad for performance.

  • Hey Bill,

    I'd start by making the table wider. Table scans on very narrow tables are still going to be fast. You also have to consider that in a query, it wont normally be just one table. Even in your test situation adding an index should speed things up a lot. It's not just about speed, using an index to eliminate a table scan will reduce the IO and CPU usage, giving you the ability to handle more concurrent queries without maxing the box.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply