Hi,
when talking about optimizing of your website I don't mean to reduce the number of pages on your site! I mean the optimization of the script that works at your site to produce pages (I assume it is database-driven). For instance, if the page on your site is prepared in average 2 seconds, then for 500,000 pages it will take AT LEAST 1,000,000 seconds (more than 11 days). But if your site produces the pages within 0,2 seconds each (because of software or hardware improvement), then the same sitemap will be created within 2 days (approximately).