It was fixed, but it started doing it again the next day. Most times, it stays revved up in park or neutral and sometimes while driving. My fuel economy is very poor as well. Your Mazda's symptoms are a classic example of what happens to fuel injected engines that have a vacuum leak. As extra air enters the intake manifold through the vacuum leak, the computer compensates by injecting more fuel.
Fuel economy drops and the engine speed goes up.
The computer tries to lower it with its idle air control valve. If the vacuum leak is too large, the idle cannot be controlled and a trouble code may sometimes set. Your problem sounds like it is intermittent, so I suspect a cracked vacuum hose or a sticking PCV valve. A careful inspection of all hoses will probably find the cause. If the hoses are OK, replace the PCV valve and check for leaking intake manifold gaskets.