There is an idle air control valve on the top of the throttle that regulates idle air - as it warms up, it allows less air to "Bypass" the throttle. In fact, Mazda calls it a Bypass valve. Yours is probably stuck wide open. They get gummed up over the years and will tend to stick.
Also, a bad engine coolant temperature probe will also cause idle problems. Does the idle ever come down once the engine warms up?
You can test each of the those two parts, but even if each tests OK doesn't guarantee that they're are not faulty.
IAC Valve:
Disconnect ISC valve electrical connector. Connect ohmmeter to ISC valve 2-wire connector. Measure resistance. See ISC RESISTANCE SPECIFICATIONS table. If resistance is not within specification, replace ISC valve.
Here is the procedure for the coolant temp probe. If you don't want to pull the probe and do the heated water thing, you can probably get a descent idea if there are any obvious problems by checking it still in the thermostat when you know the temp is in the neighborhood of 68 or 176.
Remove engine coolant temperature sensor. Place sensor and thermometer in container of coolant. Connect ohmmeter to sensor terminals. Slowly heat coolant. Note resistance at specified temperatures. See appropriate ECT SENSOR RESISTANCE table. Replace sensor as necessary.
Temperature Ohms
-4 F (-20C) 14,500- 17,800
68 F (20 C) 2,200 - 2,700
176 F (80 C) 200 - 400