Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1839647673E for ; Fri, 27 Sep 2002 13:34:04 -0400 (EDT) Received: from mail.astrofoto.org (dsl092-102-177.nyc2.dsl.speakeasy.net [66.92.102.177]) by postgresql.org (Postfix) with ESMTP id 4A7FB4762D8 for ; Fri, 27 Sep 2002 13:34:02 -0400 (EDT) Received: from kuiper.rlent.pnet (IDENT:root@kuiper.rlent.pnet [192.168.3.50]) by mail.astrofoto.org (8.12.3/8.12.3) with ESMTP id g8RHY1UZ013357 for ; Fri, 27 Sep 2002 13:34:01 -0400 Received: (from roland@localhost) by kuiper.rlent.pnet (8.11.6/8.11.6) id g8RHY0807019; Fri, 27 Sep 2002 13:34:00 -0400 X-Authentication-Warning: kuiper.rlent.pnet: roland set sender to roland@astrofoto.org using -f To: Subject: Re: Fw: Sub SELECTS References: <00a701c264a3$05bb4100$705e5ecb@A.GEEKIYANAGE> From: Roland Roberts Date: 27 Sep 2002 13:34:00 -0400 In-Reply-To: <00a701c264a3$05bb4100$705e5ecb@A.GEEKIYANAGE> Message-ID: Lines: 18 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.90 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/57 X-Sequence-Number: 1512 >>>>> "Waruna" == Waruna Geekiyanage writes: Waruna> I have a select query with 2 sub selects. When I run that Waruna> query CPU usage goes to 98% for postgres. Does sub Waruna> selects eat more resources and slower the queries? Is Waruna> there any alternatives to sub selects? You are going to have to give us a clue as to what those sub-selects are and what they are doing. If there is an "order by" clause anywhere, that could cause high CPU. If the query is not using indicies, that might cause a problem. Have you tried EXPLAIN? roland -- PGP Key ID: 66 BC 3B CD Roland B. Roberts, PhD RL Enterprises roland@rlenter.com 76-15 113th Street, Apt 3B roland@astrofoto.org Forest Hills, NY 11375