Ray Bannon <bannonr(at)comcast(dot)net> writes:> Any way to write this more efficiently?
UNION -> UNION ALL, perhaps? Do you really need UNION's duplicate-row-elimination behavior?
regards, tom lane