For such big list you need to ask yourself something first
- Do you really want to put 1 million rows in a dropdown?
- Wouldn't be easier to show several dropdowns and fillup the next one based on the previous selection?
- You could have a div emulating a dropdown and when the scroll bar reached the end you could load more rows...
Best approach is to sort in in categories and show the user a wizard alike step by step process with several dropdowns as I doubt that anyone will read 1 million of records.
if you still want to go for that weird step of showing everything in just one dropdown, you can easily cache the result for a period of time, and when request to fillup the data, it will use what's in memory and never reached the database.
Or, if it's something that does not change that much, you could load 1 million rows from a text file witch is faster that connect to the database... and then refresh that file on request or automatically.