Caterpillar Inc. (CAT 0.45%) recently released its retail machinery sales numbers for the three months ended May 31 -- and they're encouraging, to say the least. Caterpillar's worldwide machine sales were up 8% over the comparable period last year. It's difficult to ignore this growth, given how Caterpillar's sales have trended downward for several years now.

More importantly, this is the third consecutive three-month rolling period when Caterpillar has reported growth in year-over-year sales. So is this the turnaround Caterpillar investors have waited for? Well, there are several indicators of better days ahead for the company, if not the best of all. I'll talk about what that could mean for the stock later, but first, let's see what's fueling sales at the construction and mining equipment behemoth.

Visible signs of a turnaround

A breakdown of Caterpillar's latest retail sales statistics reveals a substantial improvement in each of its three segments. While sales at construction industries rose an impressive 11% over the comparable three-month rolling period ended May last year, energy and transportation (E&T) sales grew 4%, with the biggest contribution coming from oil and gas. Sales from resource industries (the mining equipment division) were down 3%, but that isn't so bad when you realize that's the smallest decline for the segment in at least three years.

Heavy equipment in an open-pit mine.

Mining holds the key to Caterpillar's recovery. Image source: Getty Images.

Does that mean mining has bottomed out?

Investors who've stuck with Caterpillar through the downturn will remember that it was the end of the commodities boom that struck down the company's growth some years ago. Mining isn't really out of the woods yet, as demand for equipment remains low, and it's primarily the aftermarket that's driving Caterpillar's sales -- but even the slightest improvement is important, as Caterpillar's fortunes depend greatly on the health of the mining sector.

Why you shouldn't underestimate aftermarket demand

There are three important points to consider here. First, aftermarket demand has historically been a leading indicator of recovery for heavy-machinery markets. In other words, a strong aftermarket is usually a harbinger of a recovery, which also partly explains why Caterpillar lifted its fiscal 2017 revenue outlook by 5% at the midpoint last quarter.

The case for an impending recovery in equipment markets is further strengthened by the fact that several industrial companies have reported strong aftermarket sales in recent months. For example, engine maker Cummins, which serves similar end markets, credited strong aftermarket demand, especially from the mining and oil and gas sectors, for much of the 9% improvement in its Q1 power-systems revenue. Any uptick in oil and gas is good news for Caterpillar's E&T segment.

Third, and most importantly, key commodities are better priced today, and metal and mining producers are getting higher prices for their output than they did last year, as evidenced by the rising U.S. Producer Price Index for copper, nickel, lead, and zinc.

Iron Ore Spot Price (Any Origin) Chart

Iron Ore Spot Price (Any Origin) data by YCharts

Meanwhile, gold mining is on strong footing, and Australian miners also appear to be displaying greater confidence in their capital-expenditure plans.

If anything, these points reflect a buildup of momentum in mining. Meanwhile, demand for construction equipment from international markets such as Asia-Pacific and Latin America remains strong: Caterpillar reported 52% and 9% growth in sales, respectively, from the two regions for the three months ended May 31.

In fact, Caterpillar's total worldwide retail machinery sales, which include sales from all three segments, have been trending upward for some months now, indicating a broader recovery:

Chart showing Caterpillar's retail machinery sales statistics since May 2016.

Data source: Caterpillar financials. Chart by author.

Another key trend I'm watching closely is Caterpillar's backlog, which is a key number to gauge where the company's top line could be headed. With Caterpillar now reporting two consecutive quarters of higher year-over-year backlog -- its first-quarter backlog grew 13% year over year and 22% sequentially -- it appears the worst is behind the company.

A dividend increase is great, but...

In another recent move that may have surprised investors, Caterpillar bumped up its dividend last month. Investors shouldn't read much into it, though, for two reasons: The hike is a meager 1%, and the only reason for it appears to be management's effort to keep its dividend streak alive. The thing is, Caterpillar has increased its dividends every year for 23 consecutive years, so missing out a year would mean losing an opportunity to make it to the elite Dividend Aristocrat list that includes companies with at least 25 years of consecutive annual dividend increases. No company would want to miss a chance to join that club.

So don't think Caterpillar boosted its dividend because business conditions are improving. In fact, Caterpillar downgraded its full-year earnings-per-share outlook last quarter on higher restructuring charges, which means fiscal 2017 could be among the company's least profitable years.

Cautious optimism

Caterpillar stock is already up almost 40% in the past year and is currently trading at levels close to where they were in 2012, when sales and profits were at their peak. In other words, the market is pricing the stock as if the company is already generating strong sales and profits, which clearly isn't the case. So while investors can remain hopeful about Caterpillar's prospects in the long run, the recovery could be painfully slow, which could cap the stock's upside in the short-term.