I have an SQL Table containing millions of data (hierarchical) like show below. I need to provide a Asp.net Web API for generating JSON for this, what would be the optimized way to do this.. ? Getting the entire data in a single shot would be a time consuming sluggish operation. Please advise.
ID Name ParentID
1 Parent NULL
2 Parent1 NULL
3 Parent2 NULL
4 Parent3 NULL
5 Child1 1
6 Child2 5
7 Child3 6
8 Child4 6
9 Child5 6
10 Child6 6