Thomas Guettler wrote:
My naive first solution was quite slow. Why is it so slow? I guess (select d.master_id from detail as d) gets executed for every master-row. But why? Shouldn't it be possible to calculate it once and then reuse it?
Please show exact schema dumps and your PostgreSQL version. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general