BaSO4 is an ionic compound, yet it is insoluble in water because both Ba2+ and SO2-4 are big and bigger cation stabilises bigger anion strongly hence BaSO4 has high lattice enthalpy. For a compound to be soluble, it’s lattice enthalpy should be low and it should decrease more rapidly than hydration enthalpy. Now since both so, it is insoluble in water.