This will not a problem for DBGrid, because it shows only a window of the underlaying Dataset. Normally only a subset of rows is normally fetched from the server, not all data.
Fetching of millions rows in a dataset is normally a design no go. It makes no sense.