X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 26006533AE for ; Fri, 13 May 2005 19:15:40 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 32694-05 for ; Fri, 13 May 2005 22:15:39 +0000 (GMT) Received: from server07.icaen.uiowa.edu (server07.icaen.uiowa.edu [128.255.17.47]) by svr1.postgresql.org (Postfix) with ESMTP id B514A52A4D for ; Fri, 13 May 2005 19:15:37 -0300 (ADT) Received: from server11.icaen.uiowa.edu (server11.icaen.uiowa.edu [128.255.17.51]) by server07.icaen.uiowa.edu (8.13.3/8.12.9) with ESMTP id j4DMFaSv018328; (envelope-from ) Fri, 13 May 2005 17:15:36 -0500 (CDT) Received: from [192.168.1.13] (12-215-118-172.client.mchsi.com [12.215.118.172]) (authenticated user=jfmeinel) by server11.icaen.uiowa.edu (8.13.2/smtp-serv-1.7) with ESMTP id j4DMFJfK007910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256); (envelope-from ) Fri, 13 May 2005 17:15:36 -0500 (CDT) Message-ID: <428526FD.7010208@arbash-meinel.com> Date: Fri, 13 May 2005 17:15:25 -0500 From: John Arbash Meinel User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sebastian Hennebrueder Cc: pgsql-performance@postgresql.org Subject: Re: Optimize complex join to use where condition before References: <4283D985.4080908@laliluna.de> <428414DE.8030904@laliluna.de> <42852509.6060206@laliluna.de> In-Reply-To: <42852509.6060206@laliluna.de> X-Enigmail-Version: 0.91.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig866AFF3AC4D1F6BC88DA2F6C" X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on clamav.icaen.uiowa.edu X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on clamav.icaen.uiowa.edu X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200505/275 X-Sequence-Number: 12439 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig866AFF3AC4D1F6BC88DA2F6C Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sebastian Hennebrueder wrote: > I found a solution to improve my query. I do not know why but the > statistics for all column has been 0. > I changed this to 10 for index columns and to 20 for all foreign key > columns. > and to 100 for foreign key columns. > I set the random page cost to 2 > and now the query runs as expected. > > Many thanks to all of the posts in my and in other threads which > helped a lot. > > Sebastian I think 0 = use default. But still, changing to 20 and 100 probably fixes your problems. John =:-> --------------enig866AFF3AC4D1F6BC88DA2F6C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFChSb9JdeBCYSNAAMRAsFyAKDU/neACCDvUBxrQEqdFPJ5bNvk8wCeO3WC QLyFSaGJK7DliPQoyzssnrw= =5Rei -----END PGP SIGNATURE----- --------------enig866AFF3AC4D1F6BC88DA2F6C--