Re: [GENERAL] Place of subselect

2008-11-25 Thread Tom Lane
"Guillaume Bog" <[EMAIL PROTECTED]> writes: > I have performance issues if I do the following pseudo-query: > SELECT a, b, (SELECT count(*) FROM t2 WHERE something) AS c > FROM t1 ORDER BY a LIMIT 10; > After some tests, it seems to me that the subquery on t2 is computed for all > rows of t1. Ye

Re: [GENERAL] Place of subselect

2008-11-25 Thread A. Kretschmer
am Tue, dem 25.11.2008, um 16:44:34 +0800 mailte Guillaume Bog folgendes: > It seems that you are right. By further testing I found that a WHERE condition > in the subquery was making the query hundred times slower. As I'm not very > familiar with explain analyze, I paste them below. Why do I have

Re: [GENERAL] Place of subselect

2008-11-25 Thread Guillaume Bog
On Tue, Nov 25, 2008 at 15:56, A. Kretschmer < [EMAIL PROTECTED]> wrote: > am Tue, dem 25.11.2008, um 15:34:57 +0800 mailte Guillaume Bog folgendes: > > Hi dear Postgres users. > > > > I have performance issues if I do the following pseudo-query: > > > > SELECT a, b, (SELECT count(*) FROM t2 WHER

Re: [GENERAL] Place of subselect

2008-11-24 Thread A. Kretschmer
am Tue, dem 25.11.2008, um 15:34:57 +0800 mailte Guillaume Bog folgendes: > Hi dear Postgres users. > > I have performance issues if I do the following pseudo-query: > > SELECT a, b, (SELECT count(*) FROM t2 WHERE something) AS c > FROM t1 ORDER BY a LIMIT 10; > > After some tests, it seems to

[GENERAL] Place of subselect

2008-11-24 Thread Guillaume Bog
Hi dear Postgres users. I have performance issues if I do the following pseudo-query: SELECT a, b, (SELECT count(*) FROM t2 WHERE something) AS c FROM t1 ORDER BY a LIMIT 10; After some tests, it seems to me that the subquery on t2 is computed for all rows of t1. As I don't "ORDER BY c", there i