For the best skill gain, you will want to fail to mine the ore sometimes; about 10-15 failures (1QL) is the best skill gain. If you fail more, improve your [[pickaxe]] or downgrade an ore difficulty.
Note that if the tile is capped at a QL much lower than your skill you won't be able to check average QL of the pile of ore/shards to see whether or not you have a decent success rate. The average QL of the pile is '''always''' based on your skill and not the tile itself, and the tile QL is therefore irrelevant to skillgain. A wider range in upper QL based on skill will get lost when translated to the tile capped with lower QL so it will look like more top QL gains but in reality they would've been higher in QL if the tile was. For example: If you have 70 mining and you mine a QL32 rock tile and get 1xQL1 and 49xQL32 you don't actually get 49xHighest possible quality - the tile just doesn't go any higher so the ones that would've been in the range between 32-70 are all translated down to 32 due to the cap. The skillgain from a QL32 and a QL70 rock tile is exactly the same.
''Note: Never mine gold for skill; it is a waste of materials and time. You have less than the optimal skill gain % chance to get ore-QL > 1/2 skill.''