X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5C24B9DD559 for ; Mon, 12 Dec 2005 12:24:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 64786-05 for ; Mon, 12 Dec 2005 12:24:43 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from hotmail.com (bay101-f36.bay101.hotmail.com [64.4.56.46]) by postgresql.org (Postfix) with ESMTP id A7C0C9DD55D for ; Mon, 12 Dec 2005 12:24:42 -0400 (AST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 12 Dec 2005 08:24:41 -0800 Message-ID: Received: from 64.4.56.200 by by101fd.bay101.hotmail.msn.com with HTTP; Mon, 12 Dec 2005 16:24:40 GMT X-Originating-IP: [84.210.10.106] X-Originating-Email: [bealach_na_bo@hotmail.com] X-Sender: bealach_na_bo@hotmail.com In-Reply-To: <91002EEA-58BC-46F0-9F27-AEC11A50A02C@sitening.com> From: "Bealach-na Bo" To: tfo@sitening.com Cc: pgsql-performance@postgresql.org Subject: Re: Very slow queries - please help Date: Mon, 12 Dec 2005 16:24:40 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 12 Dec 2005 16:24:41.0147 (UTC) FILETIME=[8DC1D8B0:01C5FF38] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.919 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479, DNS_FROM_RFC_POST=1.44, MSGID_FROM_MTA_HEADER=0] X-Spam-Score: 1.919 X-Spam-Level: * X-Archive-Number: 200512/292 X-Sequence-Number: 16113 Thanks very much - there are a lot of good articles there... Reading as fast as I can :) Best, Bealach >From: "Thomas F. O'Connell" >To: Bealach-na Bo >CC: PgSQL - Performance >Subject: Re: [PERFORM] Very slow queries - please help >Date: Sun, 4 Dec 2005 00:40:01 -0600 > > >On Nov 24, 2005, at 12:14 PM, Bealach-na Bo wrote: > >>The consensus seems to be that I need more indexes and I also need to >>look into the NOT IN statement as a possible bottleneck. I've >>introduced the indexes which has led to a DRAMATIC change in response >>time. Now I have to experiment with INNER JOIN -> OUTER JOIN >>variations, SET ENABLE_SEQSCAN=OFF. >> >>Forgive me for not mentioning each person individually and by name. >>You have all contributed to confirming what I had suspected (and >>hoped): that *I* have a lot to learn! >> >>I'm attaching table descriptions, the first few lines of top output >>while the queries were running, index lists, sample queries and >>EXPLAIN ANALYSE output BEFORE and AFTER the introduction of the >>indexes. As I said, DRAMATIC :) I notice that the CPU usage does not >>vary very much, it's nearly 100% anyway, but the memory usage drops >>markedly, which is another very nice result of the index introduction. >> >>Any more comments and tips would be very welcome. > >You might find the following resources from techdocs instructive: > >http://techdocs.postgresql.org/redir.php?link=/techdocs/ >pgsqladventuresep2.php > >http://techdocs.postgresql.org/redir.php?link=/techdocs/ >pgsqladventuresep3.php > >These documents provide some guidance into the process of index selection. >It seems like you could still stand to benefit from more indexes based on >your queries, table definitions, and current indexes. > >-- >Thomas F. O'Connell >Database Architecture and Programming >Co-Founder >Sitening, LLC > >http://www.sitening.com/ >110 30th Avenue North, Suite 6 >Nashville, TN 37203-6320 >615-260-0005 (cell) >615-469-5150 (office) >615-469-5151 (fax) > >---------------------------(end of broadcast)--------------------------- >TIP 2: Don't 'kill -9' the postmaster