Small business optimism rose in May to its highest level in more than 30 years, helped by all-time highs in some key index components, the National Federation of Independent Business said Tuesday.

Expectations for business expansion and reports of positive earnings trends hit record highs, while expectations for strong increases in real sales reached their highest since 1995.

Reports of compensation increases also hit their highest in the history of the index.

Small businesses account for about 40 percent of total hiring and are a good indicator on overall economic activity, Joseph Lavorgna, chief economist for Americas at Natixis, said in a note Tuesday.

The percent of firms in the NFIB survey expecting higher real sales tends to lead GDP by one quarter, which indicates second quarter growth should pick up to at least 3 percent, Lavorgna said.

Source: NFIB, BEA, Haver Analytics, Natixis

The U.S. economy grew at a 2.2 percent annualized rate in the first quarter, according to the second estimate from the U.S. Department of Commerce.

"Small business owners are continuing an 18-month streak of unprecedented optimism which is leading to more hiring and raising wages," NFIB chief economist Bill Dunkelberg said in a statement. "While they continue to face challenges in hiring qualified workers, they now have more resources to commit to attracting candidates."

Overall, the small business optimism index's reading of 107.8 in May marked an increase of 3 points from the prior month and the second-highest level in the index's 45-year history. The record high hit in 1983 is just 0.2 points more at 108.0.

"The new tax code is returning money to the private sector where history makes clear it will be better invested than by a government bureaucracy," a commentary in the NFIB report said. "Regulatory costs, as significant as taxes, are being reduced."

Small business optimism index (1986-2018)

Source: National Federation of Independent Business. Data collected on a monthly basis since 1986, quarterly since 1973.