Avatar billede yezper Nybegynder
17. januar 2002 - 19:55 Der er 3 kommentarer og
1 løsning

Clustered vs. nonclustered index

Til et mellemstort site anvender vi MS SQL 7 som backend database.

Vi begyndte at få problemer med performance på vores databaseserver, fordi vi havde glemt at indexere de forskellige tabeller i databasen.

Vi har nu indexeret de tabeller, der bruges meget, men har indtil nu brugt nonclustered indexes.

Er der nogen der kan forklare forskellen på clustered og nonclustered indexes, fortælle lidt omkring fordele og ulemper ved hver slags m.v.?

Det at vi indexerede tabellerne gjorde, at serveren blev omkring 50% mindre belastet, men ville vi kunne høste fordele af at anvende clustered indexes?

Mvh. Jesper
Avatar billede terry Ekspert
17. januar 2002 - 20:18 #1
yezper>It would be much easier for you to read up on this in Books Online. I have just had a look myself and I think that a full explanation rather than a couple of lines would be to your anvantage.
But here is one reason why you will end up using NONCLUSTERED more than CLUSTERED

Because the clustered index dictates the physical storage order of the data in the table, a table can contain only one clustered index.
Avatar billede yezper Nybegynder
18. januar 2002 - 14:17 #2
As far as I can see, the BOL doesn\'t state and pros and cons of using clustered instead of nonclustered indexes and vice verca.
Can you tell me something about this? What performance issues do I have to consider etc.?
Avatar billede terry Ekspert
18. januar 2002 - 15:24 #3
This is taken from Mocrosoft documnetation from a course I have been on.
Reading this I understand it as saying that you should ALWAYS create a CLUSTERED (you can only create one) and then your NO-CLUSTERED. This is done for PERFORMANCE reasons. So you could say there are no \"fordele eller ulemper\" its just the correct way to do things. Thgats more than likely who you cant find anything on this in BOL.

Take the following actions to reduce the impact on performance when you create or use indexes.

Create Indexces on foreign keys.

Create CLUSTERED indexes before NONCLUSTERED because CLUSTERED change the physical row order of the table.

Consider creating composite indexes

Create multiple indexes for a table whcih is reda frequently
Avatar billede yezper Nybegynder
18. januar 2002 - 17:53 #4
Thank you for your help :-)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester