Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 51758475E82 for ; Sat, 14 Sep 2002 10:59:36 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 987D4475E4D for ; Sat, 14 Sep 2002 10:59:35 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g8EExZ5D026721; Sat, 14 Sep 2002 10:59:35 -0400 (EDT) To: "Niclas Gustafsson" Cc: pgsql-admin@postgresql.org Subject: Re: LEFT JOINs takes forever...almost. In-reply-to: <000301c25b0c$93fd6e70$b700a8c0@gmg> References: <000301c25b0c$93fd6e70$b700a8c0@gmg> Comments: In-reply-to "Niclas Gustafsson" message dated "Fri, 13 Sep 2002 12:01:49 +0200" Date: Sat, 14 Sep 2002 10:59:35 -0400 Message-ID: <26720.1032015575@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/160 X-Sequence-Number: 5699 "Niclas Gustafsson" writes: > Can someone please explain why the first query is 3000 times slower? > Surely there must be a any way to speed it up? You're forcing a poor join order. See http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/explicit-joins.html regards, tom lane