It depends on the orderbook when you place your order, and how you place the order. If there's a sell order for more than 500,000 shares at a price that's agreeable to you, then yes, you'd buy in to that order and fill immediately. If there isn't a sufficient order at an agreeable price you'd have to either adjust your price to eat up the existing orders or wait and let people sell in to your buy order (assuming, of course, that someone doesn't place a new buy order at a price lower than yours before yours is filled).
You need to remember that the stock market is like a Bazaar, not a super market. The prices of things fluctuate and are being negotiated constantly.