Here I have learned that when you have a densely planted tank (meaning the tank floor is filled with plants' root systems) and you're afraid that you may be getting dangerous gas pockets forming in your substrate due to compaction, you can use thin long sticks and gently poke your substrate with them. This is not exactly to vacuum your gravel but rather to oxygenate it.
On plant geek, however, people who have densely planted tanks told me they never stir their substrates and that they don't get any toxic gas pockets. The only reason for this being so must be that the plants' roots themselves oxygenate the substrate enough not to allow the compaction to occur. What they do is they siphon out only the dirt that lies at a tank's bottom, and they don't stir and deep-vacuum the gravel because they don't want to damage the roots.
But I'd also add that when you have a sand-only substrate, or a substantial amount of sand, you should stir the substrate then. Compaction will occur in a sand substrate if not stirred regularly. And once the dangerous gas pockets are released into the water, they will kill the fish instantly.