Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id DE3C01337C9C for ; Fri, 14 Jan 2011 12:03:00 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 71146-02 for ; Fri, 14 Jan 2011 16:02:53 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id 46A2D13385B8 for ; Fri, 14 Jan 2011 11:52:35 -0400 (AST) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id p0EFqZmb010763 for ; Fri, 14 Jan 2011 17:52:35 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id p0EFqZte010762 for pgsql-admin@postgresql.org; Fri, 14 Jan 2011 17:52:35 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: pgsql-admin@postgresql.org Subject: Re: Postgresql 9.0.2 explain analyze very slow (10x), compared to actual query time User-Agent: KMail/1.9.7 References: <201101111753.22602.achill@matrix.gatewaynet.com> <201101141553.38236.achill@matrix.gatewaynet.com> <4D300C2E0200002500039569@gw.wicourts.gov> In-Reply-To: <4D300C2E0200002500039569@gw.wicourts.gov> MIME-Version: 1.0 Content-Disposition: inline Date: Fri, 14 Jan 2011 17:52:34 +0200 Content-Type: text/plain; charset="iso-8859-7" Content-Transfer-Encoding: quoted-printable Message-Id: <201101141752.34986.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.451 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_BRBL_LASTEXT=1.449 X-Spam-Level: X-Archive-Number: 201101/85 X-Sequence-Number: 36525 =D3=F4=E9=F2 Friday 14 January 2011 16:41:18 =E3=F1=DC=F8=E1=F4=E5: > Achilleas Mantzios wrote: > =20 > > and NOT EXISTS=20 > > (SELECT distinct mold.id from marinerstates > =20 > Does that do better if you leave out the DISTINCT keyword? Maybe > use * instead of the column name? Its already really fast, it doesn't matter. Anyways just tried without the = distinct=20 =2E..NOT EXISTS (SELECT 1 from ... and its the same (high) speed. The other form (NOT IN) is the problem (in t= he case of postgresql-9.0.2). (in 8.3 both queries are fast) > =20 > -Kevin >=20 =2D-=20 Achilleas Mantzios