I can't imagine you need millions of rows of data in your form. Human users can't do anything with that amount of data.
What are you trying to accomplish? You are going to need to parameterize your query to only return data your user needs - return a filtered data set. Code or qRules can help you achieve this.