On heating potassium nitrate, it melts and decomposes to potassium nitrite, an inorganic compound and oxygen gas. This is a chemical change that gives a pale yellow residue. The temperature required to melt is in between 550 to 790o C.
2KNO2 ⇔ 2KNO2 + O2
Potassium nitrate used near fire hazards in a storage form.
Also, potassium nitrate can be oxidized to potassium nitrite with the help of nitrifying bacteria (nitrobacter) and the process is also known as Nitrosomas.