A deep sandbed should be at least 3-4 inches deep to form the anoxic zones necessary for full processing of the nitrates. It can be as deep as 6 inches or more if so desired. A lot depends on what animals you will be stocking that could disrupt the deeper parts of the sandbed such as burrowing fish, e.g., jawfish or engineer gobies, the latter which are constantly reconstructing new burrows. As far as phosphate goes, it is mainly derived from feeding, not your substrate. Dosing kalkwasser, growing macroalgae and using a phosphate adsorption matrix are your best ways to export phosphates.