I'm assuming (see next paragraph if my assumption is wrong) that it's a 1-1 relationship between master and detail ie you don't really have a trillion detail rows. In which case you seem to have exactly the same case as with Google search. They for one do not allow you to search for a blank string, but beyond that it seems like you just need to copy what they do with displaying the page detail to the right when you click on one of the rows, plus the pagination as you planned. 

If you do have that many detail rows, then either think of the concept of drilling down from an excel pivot table where double clicking on a master row brings up all the detail rows. Or follow the Google path of 'search within these results' so you have a link below the master row that would bring up the paginated detail results rather than double click.