Click here to Skip to main content
15,887,746 members
Home / Discussions / Database
   

Database

 
GeneralRe: Query problem Pin
Niladri_Biswas6-Jun-09 20:44
Niladri_Biswas6-Jun-09 20:44 
QuestionDefault Collation Pin
hadad3-Jun-09 22:03
hadad3-Jun-09 22:03 
QuestionPerfomance on the Following Query Pin
Vimalsoft(Pty) Ltd3-Jun-09 20:54
professionalVimalsoft(Pty) Ltd3-Jun-09 20:54 
AnswerRe: Perfomance on the Following Query Pin
Ashfield3-Jun-09 21:04
Ashfield3-Jun-09 21:04 
GeneralRe: Perfomance on the Following Query Pin
Vimalsoft(Pty) Ltd3-Jun-09 21:34
professionalVimalsoft(Pty) Ltd3-Jun-09 21:34 
GeneralRe: Perfomance on the Following Query Pin
Ashfield4-Jun-09 1:31
Ashfield4-Jun-09 1:31 
GeneralRe: Perfomance on the Following Query Pin
smcnulty20004-Jun-09 1:58
smcnulty20004-Jun-09 1:58 
AnswerRe: Perfomance on the Following Query Pin
smcnulty20003-Jun-09 22:36
smcnulty20003-Jun-09 22:36 
Short answer: try removing the index.

Long answer:

How many records are you putting in? That's pretty critical to discussing this. 29 seconds with a billion records is different than 29 seconds with a 1000 records.

You might be better off without the index. I recommend you drop the index and retest your speeds without it.
Realize that indexes are great for lookup but there is a price to pay when you write to a table.

Every time you write to the table, the system has to rebuild the index and since you are using a clustered index you are reordering the data blocks in the same order as the index. So you write, then insert the next line, then reorder, then rewrite the whole mess. That's not exactly efficient.

And because it is a primary key the system will check the uniqueness of each line entered every one of those checks costs you.

Equally important is the fact that you are indexing all columns in one index. You really are just trading disk reads in one place for disk reads in another.

On the other side; when someone runs a select against this table what percentage of the data will be returned on a regular basis? Will it be 5% or less? Or will it be most of the table.

If you aren't going to see 5% or less then having an index is just a waste. Full table scans would be quicker.

With all of that in mind; if you must have the index then see if you can code the situation so that it drops the index, then inserts all the data in one fell swoop, then rebuilds the index.

_____________________________
Those who study history are doomed to watch others repeat it. -Scott M.


GeneralRe: Perfomance on the Following Query Pin
Vimalsoft(Pty) Ltd4-Jun-09 0:00
professionalVimalsoft(Pty) Ltd4-Jun-09 0:00 
GeneralRe: Perfomance on the Following Query Pin
Ashfield4-Jun-09 1:24
Ashfield4-Jun-09 1:24 
GeneralRe: Perfomance on the Following Query Pin
smcnulty20004-Jun-09 1:37
smcnulty20004-Jun-09 1:37 
QuestionFind feature in report viewer not working in Reporting services Pin
catmom3-Jun-09 10:51
catmom3-Jun-09 10:51 
QuestionRestore Database Parallel in sqlserver 2005 Pin
s_rajakrishna3-Jun-09 2:45
s_rajakrishna3-Jun-09 2:45 
Questionsql view Pin
jainiraj2-Jun-09 21:34
jainiraj2-Jun-09 21:34 
AnswerRe: sql view Pin
smcnulty20003-Jun-09 15:34
smcnulty20003-Jun-09 15:34 
AnswerRe: sql view Pin
_Damian S_3-Jun-09 16:04
professional_Damian S_3-Jun-09 16:04 
AnswerRe: sql view Pin
A k ch4-Jun-09 22:09
A k ch4-Jun-09 22:09 
Questioncreate proc from assembly Pin
Abdul Rahman Hamidy2-Jun-09 21:22
Abdul Rahman Hamidy2-Jun-09 21:22 
AnswerRe: create proc from assembly Pin
Abdul Rahman Hamidy2-Jun-09 22:01
Abdul Rahman Hamidy2-Jun-09 22:01 
GeneralRe: create proc from assembly Pin
Abdul Rahman Hamidy2-Jun-09 22:10
Abdul Rahman Hamidy2-Jun-09 22:10 
QuestionFind working hours between two dates Pin
Rajesh VR2-Jun-09 20:31
Rajesh VR2-Jun-09 20:31 
AnswerRe: Find working hours between two dates Pin
Blue_Boy2-Jun-09 20:54
Blue_Boy2-Jun-09 20:54 
AnswerSQL function GetBusinessDays Pin
David Mujica3-Jun-09 2:58
David Mujica3-Jun-09 2:58 
QuestionProblem with Bulk insert and insert trigger Pin
www.Developerof.NET2-Jun-09 18:45
www.Developerof.NET2-Jun-09 18:45 
QuestionAll Sql Command Pin
Satish Pai2-Jun-09 18:19
Satish Pai2-Jun-09 18:19 

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.