WP doesnt handle sites with lots of pages very well at all.. Their admission, not mine. You can print the content dynamically from a db by creating your own template. This works fine, but using the WP CMS to generate pages will not be a good idea. Infact, Im not sure how you could use WP to make 1m+ pages. Posts maybe, but pages?