This may not be possible, but still i would like to know if any of you have suggestions:
Is it possible to implement the functionality of a cube in a stored proc.
I have a table called:
Scores
Columns:
StudentID,YearID,ClassID,TestID,SubjectID,Score
Primary Key:
StudentID,YearID,ClassID,TestID,SubjectID
My requirements are:
i). For a given StudentID,YearID,ClassID,TestID,SubjectID i need to get top 5 scorers, top 10, top 15... and so on.
ii). For a given StudentID,YearID,ClassID,TestID i need to get top 5 scorers, top 10, top 15... and so on. In this case i need to get all SubjectIDs for each (StudentID,YearID,ClassID,TestID ) and sum all of them up and then get the top 5 or 10... etc...
iii). Also imagine we need to get the similar info just given the StudentID,YearID,ClassID or
StudentID,YearID
If we write Stored procedure we think will affect the performance severly, this is why we are thinking we need a cube... but i don't think we can get anylysis services with our budget... if you have any suggestions how to achieve/simplify the scenarios please let us know... It will be really appreciated.
Thanks.User Defined Functions, proper indexing, and use your mind to look outside of the "cube"
Make User Defined Functions to get i. ii. and iii and execute them appropriately in a stored procedure. It'll run fast if your indexes are straight, and the procedure doesn't do anything stupid or unnecessary.
No comments:
Post a Comment