Buying shares of highly reliable businesses that generate fat cash flows year after year is a time-tested strategy of some of the world's most successful investors, including the likes of Warren Buffett. And while the Oracle of Omaha doesn't own any shares of the national pharmacy chain Walgreens Boots Alliance (WBA 3.05%), many investors do, and often with mixed results. 

If you're considering making a purchase, it makes sense to look back at the pharmacy's long-term performance to get a feeling for what role it might fill in your portfolio. Let's take a look at this company's business model and calculate how much you would have made if you invested $5,000 in it 10 years ago.

You would probably regret your prior investment in this stock

Not every stock is right for every investor, and if you decided to buy Walgreens around a decade ago, there's a solid chance that you're now feeling as though it wasn't the right move for you. 

On Oct. 1, 2012, Walgreens' split-adjusted stock price closed at $35.23. That means if you bought the stock then and held it until the first of this month, you'd be looking at a total return of nearly 12% -- a pittance in comparison to the performance of an index fund like the market-tracking SPDR S&P 500 ETF, which returned nearly 199% in the same period. Keep in mind the total return includes everything from share price appreciation to stock buybacks and dividend payments, so Walgreens was strictly a worse investment than buying the S&P 500 over roughly the last 10 years. 

In dollar terms, your $5,000 investment in Walgreens would have returned a total of $5,600. On the bright side, you'd have done even worse if you invested in Rite Aid, one of Walgreens' pharmacy competitors; it has posted a negative total return of 78.6% since late 2012.

How to approach investing in this stock today

But what does all of this mean for investors today, especially when considering the old chestnut that past returns don't predict future performance? In short, you probably shouldn't be buying Walgreens with the idea that it's a growth stock that'll be rising in value with every passing year. After all, its trailing-12-month (TTM) revenue only increased 11.7% in the last five years, reaching above $134.5 billion, and it isn't reasonable to expect that pace to change by much.

There won't likely be a sudden surge in business to Walgreens' pharmacies, nor will its consumer health goods start to sell rapidly. Furthermore, it's hard to imagine new revenue initiatives capable of significantly revitalizing the stock. While its new Walgreens Health quick care clinics appear to be gaining traction and growing rapidly as a revenue segment, generating $596 million in sales during fiscal Q3, it hasn't yet been enough to drive much of anything in the way of top-line growth.

So, instead of investing for price appreciation, think about this business as a dividend-paying company that's proven it can reliably operate in a relatively low-growth niche (retail pharmacies) while remaining financially stable over time. Right now, the stock's forward dividend yield is above 6.1%, which is quite high, and Walgreens continues to hike its payout, with its dividend growing by more than 74.5% since Q4 of 2012. At that yield, your $5,000 investment today could produce around $305 in passive income annually.

That might not sound like much, but it could be a helpful addition to your other passive cash flows, and you could also opt to build up your position over time to yield more money. You'd also likely get the benefit of more dividend hikes, though probably at roughly the same slow pace as in recent times. Alternatively, it's hard to go wrong with an investment in an index fund, and it's likely that such an investment will outperform Walgreens over the coming years even if it won't produce much in the way of dividend income.