Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 04CA864FF9A for ; Thu, 21 Aug 2008 16:10:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 03718-05 for ; Thu, 21 Aug 2008 16:10:20 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 32BF064FF7E for ; Thu, 21 Aug 2008 16:10:22 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m7LJAIdn029596; Thu, 21 Aug 2008 15:10:18 -0400 (EDT) To: =?ISO-8859-1?Q?Andr=E9_Volpato?= cc: pgsql-performance@postgresql.org Subject: Re: Postgres not using array In-reply-to: <48AD80FA.30100@ecomtecnologia.com.br> References: <48AC8292.5000708@ecomtecnologia.com.br> <48AD735D.6040403@ecomtecnologia.com.br> <23465.1219328880@sss.pgh.pa.us> <48AD80FA.30100@ecomtecnologia.com.br> Comments: In-reply-to =?ISO-8859-1?Q?Andr=E9_Volpato?= message dated "Thu, 21 Aug 2008 11:51:38 -0300" Date: Thu, 21 Aug 2008 15:10:18 -0400 Message-ID: <29595.1219345818@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/257 X-Sequence-Number: 31138 =?ISO-8859-1?Q?Andr=E9_Volpato?= writes: > Tom Lane escreveu: >> So I guess the question is "what is the bds_internacoes function, and >> why is it so slow?" > This function is quite fast: Well, "fast" is relative. It's not fast enough, or you wouldn't have been complaining. > We are guessing that a dual core 3.0GHz will beat up a quad core 2.2, > at least in this environmnent with less than 4 concurrent queryes. The most you could hope for from that is less than a 50% speedup. I'd suggest investing some tuning effort first. Some rethinking of your schema, for example, might buy you orders of magnitude ... with no new hardware investment. regards, tom lane