What's the best way to list groups of values that are contained in other groups
This does the trick but is not terribly fast:

select t1.x as subset_x, t2.x as superset_x
from t t1 join t t2 on(t1.y=t2.y and t1.x&lt;&gt;t2.x)
group by t1.x, t2.x
having count(*)=(select count(*) from t where x=t1.x);