Click here to Skip to main content
16,005,121 members
Home / Discussions / Database
   

Database

 
QuestionWhich is Faster and more apprpriate to use? Pin
cbhkenshin11-Feb-06 0:20
cbhkenshin11-Feb-06 0:20 
AnswerRe: Which is Faster and more apprpriate to use? Pin
Super Lloyd11-Feb-06 1:15
Super Lloyd11-Feb-06 1:15 
AnswerRe: Which is Faster and more apprpriate to use? Pin
Colin Angus Mackay11-Feb-06 13:34
Colin Angus Mackay11-Feb-06 13:34 
QuestionSQL : SubQuery Pin
dev_rfid10-Feb-06 21:06
dev_rfid10-Feb-06 21:06 
AnswerRe: SQL : SubQuery Pin
Colin Angus Mackay10-Feb-06 22:31
Colin Angus Mackay10-Feb-06 22:31 
GeneralRe: SQL : SubQuery Pin
dev_rfid10-Feb-06 23:14
dev_rfid10-Feb-06 23:14 
QuestionTable Splitting ? Pin
cbhkenshin10-Feb-06 18:48
cbhkenshin10-Feb-06 18:48 
AnswerRe: Table Splitting ? Pin
Colin Angus Mackay10-Feb-06 22:40
Colin Angus Mackay10-Feb-06 22:40 
cbhkenshin wrote:
but the second option will give fast select and slow insert or delete and also a very large number of rows.


This isn't necessarily correct. It depends on how you are inserting the rows. For instance if they key is sequential (like an IDENTITY or a timestamp) then new rows will be appended to the the end of the table. If the key is on something more random then the rows will be potentially inserted in the middle and other rows around it will be shuffled around. But it will likely only affect one additional data page.

As for deleting, I'd guess it would still be the same speed because the row is only marked as being deleted. It isn't actually removed at the time of delete.

Have you tested your performance hypotheses? Do you know for certain that option 1 has a faster insert than option 2, and vice versa for select?

Personally (and this is without knowing the full story), I'd go for option 2 and then refactor to option 1 if it becomes a problem. Also, you didn't say which is more important, the ability to insert lots of data, or the ability to select lots of data? Which do you do more of? (That will have an influence on your final answer)

ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell

QuestionHow to eliminate duplicate rows from a table? Pin
jkrao10-Feb-06 17:33
jkrao10-Feb-06 17:33 
AnswerRe: How to eliminate duplicate rows from a table? Pin
Colin Angus Mackay10-Feb-06 22:48
Colin Angus Mackay10-Feb-06 22:48 
QuestionDatabase design Pin
TheJudeDude10-Feb-06 13:25
TheJudeDude10-Feb-06 13:25 
AnswerRe: Database design Pin
Ben Meyers10-Feb-06 18:29
Ben Meyers10-Feb-06 18:29 
GeneralRe: Database design Pin
TheJudeDude11-Feb-06 0:56
TheJudeDude11-Feb-06 0:56 
GeneralRe: Database design Pin
Rob Graham11-Feb-06 5:11
Rob Graham11-Feb-06 5:11 
GeneralRe: Database design Pin
Ben Meyers11-Feb-06 9:42
Ben Meyers11-Feb-06 9:42 
GeneralRe: Database design Pin
TheJudeDude13-Feb-06 7:14
TheJudeDude13-Feb-06 7:14 
QuestionWrong values being stored to table Pin
TheJudeDude10-Feb-06 11:37
TheJudeDude10-Feb-06 11:37 
AnswerRe: Wrong values being stored to table Pin
Paul Conrad10-Feb-06 12:26
professionalPaul Conrad10-Feb-06 12:26 
GeneralRe: Wrong values being stored to table Pin
TheJudeDude10-Feb-06 12:30
TheJudeDude10-Feb-06 12:30 
GeneralRe: Wrong values being stored to table Pin
Paul Conrad10-Feb-06 12:36
professionalPaul Conrad10-Feb-06 12:36 
GeneralRe: Wrong values being stored to table Pin
TheJudeDude10-Feb-06 12:45
TheJudeDude10-Feb-06 12:45 
QuestionHow to change DataGridView row bg color if modified Pin
BambooMoon10-Feb-06 6:12
BambooMoon10-Feb-06 6:12 
QuestionSQL Pin
dev_rfid10-Feb-06 3:02
dev_rfid10-Feb-06 3:02 
AnswerRe: SQL Pin
Michael Potter10-Feb-06 3:30
Michael Potter10-Feb-06 3:30 
GeneralRe: SQL Pin
dev_rfid10-Feb-06 3:42
dev_rfid10-Feb-06 3:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.