*8153* move submission queue logic into SQL where possible