In shotgunning, the length of the barrel isn't driven by performance of the projectile, but rather by the fact that it's easier to get hits on target while sighting down a longer tube than a shorter tube.
A lot of medium-to-heavy rifle rounds achieve higher velocity with longer barrels, and that's a function of the slow-burning powders used. Shotguns operate at much lower pressures than rifles, typically 25-30% of rifle pressures - which is why shotgun barrels have relatively thin walls. The powders used for shotgun loads are relatively fast-burning, as well (which is why you find a lot of shotgun powders used for pistol loads), so the powder charge is mostly consumed by the time the projectile reaches even 16 inches or so.
Realistically, at some shorter barrel length the load velocity will start to drop off, but that length will probably be in the 12-16 inch range, depending on the load.