Re: [GENERAL] master/detail: master rows without details

2008-12-09 Thread Thomas Guettler
Peter Eisentraut <[EMAIL PROTECTED]>Peter Eisentraut schrieb: > 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

Re: [GENERAL] master/detail: master rows without details

2008-12-09 Thread Merlin Moncure
On Tue, Dec 9, 2008 at 6:56 AM, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Hi, > > I have a two tables: master and detail. > I search all master rows without a detail row. > > master: 1 rows > detail: 29800 rows > > Although all three solution have the same result, The execution time > differ

Re: [GENERAL] master/detail: master rows without details

2008-12-09 Thread Peter Eisentraut
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 versi

[GENERAL] master/detail: master rows without details

2008-12-09 Thread Thomas Guettler
Hi, I have a two tables: master and detail. I search all master rows without a detail row. master: 1 rows detail: 29800 rows Although all three solution have the same result, The execution time differs very much. My naive first solution was quite slow. Why is it so slow? I guess (select d.