A filling is usually enough when decay has not reached the nerve of the tooth. If the nerve is infected or inflamed — often causing lingering pain, sensitivity to heat, or swelling — root canal treatment may be needed instead. An examination and X-ray will confirm which applies to you.