DBA Expert
Budget: ₹1,500 – ₹12,500 INR
Need to improve performance in existing DB Query
It's one sample of query it taking approx 1minute of time
SELECT DISTINCT QuestionNatureID,QuestionNatureName,QuestionNatureCode FROM dbo.VW_SuggestedQuestionsFilter
WHERE (@QuestionNaturelist = '00000000-0000-0000-0000-000000000000' OR QuestionNatureID IS NULL OR EXISTS (SELECT 1 from #QuestionNatureID where #QuestionNatureID.ID= QuestionNatureID))
AND (@DifficultyLevellist = '00000000-0000-0000-0000-000000000000' OR EXISTS (SELECT 1 from #DifficultyLevelID where #DifficultyLevelID.ID= DifficultyLevelID))
AND (@BloomTaxonomylist = '00000000-0000-0000-0000-000000000000' OR EXISTS (SELECT 1 from #BloomTaxonomyID where #BloomTaxonomyID.ID= BloomTaxonomyID))
AND (@QuestionLengthlist = '00000000-0000-0000-0000-000000000000' OR EXISTS (SELECT 1 from #QuestionLengthID where #QuestionLengthID.ID= QuestionLengthID))
AND ( TextBookChapterId in ( SELECT ChapterID FROM EA_PaperChapterMapping WHERE EAPaperTemplateid=@EAPaperTemplateid)
OR ChapterID in ( SELECT ChapterID FROM EA_PaperChapterMapping WHERE EAPaperTemplateid=@EAPaperTemplateid)
)
AND (@Marklist='' OR QuestionMark IN (SELECT CAST(Item AS int) FROM dbo.SplitString(@Marklist, ',')))
It's one sample of query it taking approx 1minute of time
SELECT DISTINCT QuestionNatureID,QuestionNatureName,QuestionNatureCode FROM dbo.VW_SuggestedQuestionsFilter
WHERE (@QuestionNaturelist = '00000000-0000-0000-0000-000000000000' OR QuestionNatureID IS NULL OR EXISTS (SELECT 1 from #QuestionNatureID where #QuestionNatureID.ID= QuestionNatureID))
AND (@DifficultyLevellist = '00000000-0000-0000-0000-000000000000' OR EXISTS (SELECT 1 from #DifficultyLevelID where #DifficultyLevelID.ID= DifficultyLevelID))
AND (@BloomTaxonomylist = '00000000-0000-0000-0000-000000000000' OR EXISTS (SELECT 1 from #BloomTaxonomyID where #BloomTaxonomyID.ID= BloomTaxonomyID))
AND (@QuestionLengthlist = '00000000-0000-0000-0000-000000000000' OR EXISTS (SELECT 1 from #QuestionLengthID where #QuestionLengthID.ID= QuestionLengthID))
AND ( TextBookChapterId in ( SELECT ChapterID FROM EA_PaperChapterMapping WHERE EAPaperTemplateid=@EAPaperTemplateid)
OR ChapterID in ( SELECT ChapterID FROM EA_PaperChapterMapping WHERE EAPaperTemplateid=@EAPaperTemplateid)
)
AND (@Marklist='' OR QuestionMark IN (SELECT CAST(Item AS int) FROM dbo.SplitString(@Marklist, ',')))