I should perhaps make a configurable threshold for query sizes and skip pretty formatting when if the threshold is exceeded.