Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 9CF7B2E005B for ; Wed, 9 Apr 2008 12:29:25 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 17995-04-5 for ; Wed, 9 Apr 2008 12:29:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.61.230.242]) by developer.postgresql.org (Postfix) with ESMTP id B37602E0049 for ; Wed, 9 Apr 2008 12:29:08 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id A958DD5607; Wed, 9 Apr 2008 23:29:01 +0800 (WST) Received: from localhost (access [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 4EA221E0436; Wed, 9 Apr 2008 23:29:04 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (access.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id I1EtTvIfVDy6; Wed, 9 Apr 2008 23:29:03 +0800 (WST) Received: from [203.161.97.213] (203.161.97.213.static.amnet.net.au [203.161.97.213]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTP id 70EA21E0435; Wed, 9 Apr 2008 23:29:03 +0800 (WST) Message-ID: <47FCE0B3.3040307@postnewspapers.com.au> Date: Wed, 09 Apr 2008 23:28:51 +0800 From: Craig Ringer User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: "Luigi N. Puleio" Cc: pgsql-performance@postgresql.org Subject: Re: EXPLAIN detail References: <981759.47577.qm@web33504.mail.mud.yahoo.com> In-Reply-To: <981759.47577.qm@web33504.mail.mud.yahoo.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/108 X-Sequence-Number: 29601 Luigi N. Puleio wrote: >> If for some reason you cannot do that, please at least include the data >> type of the primary key and all fields involved in the query, as well as >> a list of all the indexes on both tables. If you won't show people on the list your table definitions, or at least the information shown above, then it's less likely that anybody can help you or will spend the time trying to help you. Personally I think you may need some functional/cast, and possibly composite, indexes to avoid the looping sequential scan as I said before. However, that's guesswork without some more information as repeatedly stated and requested. I'm not going to bother replying to any further mail just to say so again. Try reading the documentation chapter about indexes: http://www.postgresql.org/docs/current/static/indexes.html and about query optimisation: http://www.postgresql.org/docs/current/static/performance-tips.html then experiment with various indexes to see what works best. Think about the data types. Remember that you can build an index on a cast of a field, on multiple fields, on function calls, or basically any other simple expression or expressions, but that complex indexes will cost more to build and maintain and might be bigger (and thus slower to search). Anyway, I'm done. -- Craig Ringer