我有這個表電話簿的SQL Server 2005:SQL插入性能問題
username(PK) Serial(PK) contact_name contact_adr contact_email contact_phone
bob 1 Steve 12 abc street [email protected] 1234
bob 2 John 34 xyz street [email protected] 5345
bob 3 Mark 98 ggs street [email protected] 1234
patrick 4 lily 77 fgs street [email protected] 1234
patrick 5 mily 76 fgs street [email protected] 1234
von 8 jim 6767 jsd way [email protected] 4564
現在你可以看到電話簿存儲同一用戶的所有聯繫人在一起。 這種方式存儲有我無法避免的優點。
我的問題是: 如果我在所有用戶的表中有1億個條目,我將來在上面的表中插入會非常昂貴嗎?
由於SQL引擎需要找到實際的位置在哪裏輸入數據(我的意思是根據該用戶名)
我有一個百萬行的測試,我看不出有明顯的問題。
我在問有沒有人對我有這樣的經驗或建議?
感謝
您將使用哪種SQL軟件? (另外,'PK'意味着在列上有一個唯一的索引,所以我猜這是你用「username」表示的外鍵(FK),'serial'是你真正的主鍵(PK)) – 2010-12-06 19:20:21
帶有重複數據的主鍵? – Sathya 2010-12-06 19:20:53
我錯過了PK。 PK是(用戶名+串行) – kheya 2010-12-06 19:37:46