Click here to Skip to main content
15,917,628 members
Home / Discussions / Database
   

Database

 
Questioninserting values by checking the existing values Pin
dsaikrishna26-Jul-07 2:12
dsaikrishna26-Jul-07 2:12 
AnswerRe: inserting values by checking the existing values Pin
Eliz.k27-Jul-07 0:20
Eliz.k27-Jul-07 0:20 
QuestionHiding Report Parameters. Pin
Karuna Kumar26-Jul-07 0:34
Karuna Kumar26-Jul-07 0:34 
QuestionStored Procedure Issue Pin
Brendan Vogt26-Jul-07 0:00
Brendan Vogt26-Jul-07 0:00 
AnswerRe: Stored Procedure Issue Pin
Mike Dimmick26-Jul-07 0:46
Mike Dimmick26-Jul-07 0:46 
GeneralRe: Stored Procedure Issue Pin
Colin Angus Mackay26-Jul-07 0:52
Colin Angus Mackay26-Jul-07 0:52 
AnswerRe: Stored Procedure Issue Pin
Colin Angus Mackay26-Jul-07 0:48
Colin Angus Mackay26-Jul-07 0:48 
GeneralRe: Stored Procedure Issue Pin
Mike Dimmick26-Jul-07 3:05
Mike Dimmick26-Jul-07 3:05 
As I said in my other answer, that approach can give poor performance because either a) the optimizer gets confused and picks a bad plan or b) the plan it picks for the first set of arguments is poor for the second set of arguments. Marking the procedure to be recompiled every time (WITH RECOMPILE) can help with the second, but you incur the cost of recompiling the plan every time (although I suspect this is largely CPU-bound, barring loading the index/table statistics from wherever SQL Server keeps them).

Any time it has to do a table scan or index scan, it's going to cost you. If the data is not yet in memory, you'll incur a lot of I/O cost reading in all the pages from disk. If it is in memory, you'll get a lot of CPU usage shown in Task Manager and Processor performance counters, but adding more/faster CPUs won't help at all because in fact the processor is just sitting in wait states waiting for the data to come into its caches from main memory. (A faster front-side bus and faster RAM modules would help.)

This assumes that the main operator for each parameter is sargable and can therefore make use of index seeks. If you're using LIKE '%value%', go ahead and do it this way, SQL Server will have to perform a table scan or clustered index scan anyway, assuming no other fixed filter parameters which are sargable.

Stability. What an interesting concept. -- Chris Maunder

GeneralRe: Stored Procedure Issue Pin
Brendan Vogt26-Jul-07 3:10
Brendan Vogt26-Jul-07 3:10 
AnswerRe: Stored Procedure Issue Pin
Aaron VanWieren26-Jul-07 2:31
Aaron VanWieren26-Jul-07 2:31 
GeneralRe: Stored Procedure Issue Pin
Brendan Vogt26-Jul-07 3:09
Brendan Vogt26-Jul-07 3:09 
Questioncoping data in sql server express Pin
Amjath Rahman25-Jul-07 22:55
Amjath Rahman25-Jul-07 22:55 
AnswerRe: coping data in sql server express Pin
Blue_Boy25-Jul-07 23:12
Blue_Boy25-Jul-07 23:12 
GeneralRe: coping data in sql server express Pin
Amjath Rahman25-Jul-07 23:24
Amjath Rahman25-Jul-07 23:24 
GeneralRe: coping data in sql server express Pin
Blue_Boy25-Jul-07 23:37
Blue_Boy25-Jul-07 23:37 
AnswerRe: coping data in sql server express Pin
Aaron VanWieren26-Jul-07 2:27
Aaron VanWieren26-Jul-07 2:27 
GeneralRe: coping data in sql server express Pin
Blue_Boy26-Jul-07 3:55
Blue_Boy26-Jul-07 3:55 
QuestionHow to reset identity(ID) field Pin
Mubashir Javaid25-Jul-07 22:09
Mubashir Javaid25-Jul-07 22:09 
AnswerRe: How to reset identity(ID) field Pin
Vasudevan Deepak Kumar25-Jul-07 22:15
Vasudevan Deepak Kumar25-Jul-07 22:15 
GeneralRe: How to reset identity(ID) field Pin
Muhammad Qasim Pasta25-Jul-07 22:37
Muhammad Qasim Pasta25-Jul-07 22:37 
AnswerRe: How to reset identity(ID) field Pin
Blue_Boy25-Jul-07 22:16
Blue_Boy25-Jul-07 22:16 
Questionasp horizontal data Pin
calvinjb888825-Jul-07 21:31
calvinjb888825-Jul-07 21:31 
AnswerRe: asp horizontal data Pin
Vasudevan Deepak Kumar25-Jul-07 22:17
Vasudevan Deepak Kumar25-Jul-07 22:17 
AnswerRe: asp horizontal data Pin
Pete O'Hanlon25-Jul-07 23:44
mvePete O'Hanlon25-Jul-07 23:44 
Questionasp horizontal data Pin
calvinjb888825-Jul-07 21:31
calvinjb888825-Jul-07 21:31 

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.