2 tablespoons plus 1/4 teaspoon salt
1 1/2 pounds baby pear tomatoes (or cherry or vine-ripened tomatoes), or one 28-ounce can Italian plum tomatoes
8 ounces thin, best-quality spaghetti
4 tablespoons extra-virgin olive oil
4 cloves garlic, cut into 1/8-inch-thick pieces
1/4 teaspoon crushed red-pepper flakes
1/4 cup fresh basil or parsley leaves, loosely packed and torn
Parmigiano-Reggiano cheese, optional