miscql cleanup