Primary Key detetion performance

  • Heeeeeeeeeeeelllo!!

    I took a peak in BOL and found out that primary keys are almost the same as indexes - they speed things up in JOINS and stuff... But is there a performance cost in deleting primary keys (as there is in indexes)? I assume there is but I just wanna be sure.

    Thanks!

    /Tomi

  • Sure. Certain amount of clean up has to be done, depending on the type type of index. Not sure why you'd be dropping your pkey very often?

    Andy

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

  • Hello!

    Well, I'm making a message sending system. And this specific table will hold all the new messages. The messages won't be saved anywhere so I just delete them immediately after the user has read it, thus I'll delete the primary key VERY often. Make sense?

    /Tomi

  • That does. Deleting a row has a cost, every index (and pkey is really an index) adds to that. Just the nature of indexes. Unless you have a lot of them...which I wouldnt expect on a messaging system, it will probably be very low cost.

    Andy

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

  • If this isn't the greatest SQL forum then what is!? Once again I got exellent help. Thank you!

    /Tomi

Viewing 5 posts - 1 through 5 (of 5 total)

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