Click here to Skip to main content
15,908,111 members
Home / Discussions / Database
   

Database

 
GeneralRe: xml sql Pin
Mycroft Holmes27-Feb-10 20:51
professionalMycroft Holmes27-Feb-10 20:51 
GeneralRe: xml sql Pin
SilimSayo1-Mar-10 16:43
SilimSayo1-Mar-10 16:43 
GeneralRe: xml sql Pin
Mycroft Holmes1-Mar-10 18:10
professionalMycroft Holmes1-Mar-10 18:10 
AnswerRe: xml sql Pin
Not Active25-Feb-10 14:15
mentorNot Active25-Feb-10 14:15 
QuestionSQL Server re-installs when already installed Pin
Rich Leyshon25-Feb-10 8:17
Rich Leyshon25-Feb-10 8:17 
AnswerRe: SQL Server re-installs when already installed Pin
Mycroft Holmes25-Feb-10 10:54
professionalMycroft Holmes25-Feb-10 10:54 
QuestionSQL Server Exported Text File Differences Pin
Member 450523625-Feb-10 3:18
Member 450523625-Feb-10 3:18 
QuestionQuery / Design Optimization help Pin
Laddie24-Feb-10 20:05
Laddie24-Feb-10 20:05 
I have a situation where i need to optimize the query to perform better. possibly a solution.
Here is the situation.

I have a table with the following fields(I am putting only those are significant to the scenirio)

WorkItems[Table]
StartDate
EndDate
Stage
CompletedDate

I need to calculate a value named status according to various conditions involving the above parameters.

Like If StartDate < getdate()
Status = Green
etc..

I created a function called CalculateStatus Passing all the above parameters and added one computed colum in the WorkItems table to call this function.
Since column is non deterministic i cant add a index to this column.

Now when i blindly do a select of status the same is getting calculated very fast

The issue is when i use this computed column with aggragate function like

1) SELECT count(Status) FROM WorkItems

Or when doing a group by

2) SELECT Count(WorkItemId),Status FROM WorkITems
Group BY Status


Could you please guid me how i could optimize the situation so that i can make things faster.


Thanks in advance for your valuable time

Sreehari ARanghat
Thanks
Laddie


Kindly rate if the answer was helpful

AnswerRe: Query / Design Optimization help Pin
Chris Meech25-Feb-10 7:00
Chris Meech25-Feb-10 7:00 
QuestionExcel to SQL Pin
MAW3024-Feb-10 15:33
MAW3024-Feb-10 15:33 
AnswerRe: Excel to SQL Pin
WoutL24-Feb-10 19:54
WoutL24-Feb-10 19:54 
AnswerRe: Excel to SQL Pin
hans vogels29-Aug-10 9:21
hans vogels29-Aug-10 9:21 
QuestionCase-Sensative Password Column in SQL Anywhere 10 Pin
MWRivera24-Feb-10 5:59
MWRivera24-Feb-10 5:59 
AnswerRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
David Skelly24-Feb-10 6:23
David Skelly24-Feb-10 6:23 
AnswerRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
PIEBALDconsult24-Feb-10 9:20
mvePIEBALDconsult24-Feb-10 9:20 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
MWRivera24-Feb-10 9:24
MWRivera24-Feb-10 9:24 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
PIEBALDconsult24-Feb-10 14:19
mvePIEBALDconsult24-Feb-10 14:19 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
WoutL24-Feb-10 10:28
WoutL24-Feb-10 10:28 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
PIEBALDconsult24-Feb-10 14:10
mvePIEBALDconsult24-Feb-10 14:10 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
WoutL24-Feb-10 19:50
WoutL24-Feb-10 19:50 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
David Skelly24-Feb-10 22:46
David Skelly24-Feb-10 22:46 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
MWRivera25-Feb-10 3:51
MWRivera25-Feb-10 3:51 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
David Skelly25-Feb-10 6:14
David Skelly25-Feb-10 6:14 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
MWRivera25-Feb-10 6:27
MWRivera25-Feb-10 6:27 
GeneralRe: Case-Sensative Password Column in SQL Anywhere 10 Pin
MWRivera3-Mar-10 4:37
MWRivera3-Mar-10 4:37 

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.