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 5AF1153DF6 for ; Wed, 13 Apr 2005 14:30:55 -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 11380-10 for ; Wed, 13 Apr 2005 17:30:46 +0000 (GMT) Received: from anchor-post-36.mail.demon.net (anchor-post-36.mail.demon.net [194.217.242.86]) by svr1.postgresql.org (Postfix) with ESMTP id 864AA5344E for ; Wed, 13 Apr 2005 14:30:45 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-36.mail.demon.net with esmtp (Exim 4.42) id 1DLlhM-0009si-JR; Wed, 13 Apr 2005 17:30:44 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 1B3EF163F0; Wed, 13 Apr 2005 18:30:38 +0100 (BST) Message-ID: <425D573B.3080208@archonet.com> Date: Wed, 13 Apr 2005 18:30:35 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joel Fradkin Cc: PostgreSQL Perform Subject: Re: speed of querry? References: <001b01c54036$d49a2290$797ba8c0@jfradkin> In-Reply-To: <001b01c54036$d49a2290$797ba8c0@jfradkin> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.059 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200504/255 X-Sequence-Number: 11652 Joel Fradkin wrote: > I must be missing something important, because I am just not seeing why this > query is slower on a 4 processor 8 gig machine running redhat AS4. Well, the 4 processors aren't going to help with a single query. However, assuming the configurations for both machines are comparable, you shouldn't be seeing a doubling in query-time. I have, however, spotted something very strange towards the bottom of each explain: > Machine 1 my desktop: > " -> Merge Right Join (cost=0.00..52366.50 rows=190710 width=75) > (actual time=16.000..1973.000 rows=177041 loops=1)" > " Merge Cond: ((("outer".clientnum)::text = > ("inner".clientnum)::text) AND ("outer".id = "inner".jobtitleid))" > Test Linux machine: > " -> Merge Right Join (cost=24825.80..27512.71 rows=176015 > width=75) (actual time=8743.848..9750.775 rows=177041 loops=1)" > " Merge Cond: ((("outer".clientnum)::text = > "inner"."?column10?") AND ("outer".id = "inner".jobtitleid))" In the first, we match outer.clientnum to inner.clientnum, in the second it's "?column10?" - are you sure the query was identical in each case. I'm guessing the unidentified column in query 2 is the reason for the sort a couple of lines below it, which seems to take up a large chunk of time. -- Richard Huxton Archonet Ltd