The S&P 500 and Nasdaq closed at record highs Tuesday as investors cheered the latest batch of solid corporate earnings, including those from blue-chip Coca-Cola Co. and social-media brands such as Twitter Inc.

How did major indexes fare?

The Dow Jones Industrial Average DJIA, -1.92% rose 145.34 points, or 0.6%, to 26,656.39, less than 1% away from its record. The S&P 500 index SPX, -2.37% added 25.71 points, or 0.9%, to 2,933.68, and the Nasdaq Composite COMP, -3.01% gained 105.56 points, or 1.3%, to 8,120.82.

What drove the market?