X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BE654DAABD for ; Thu, 27 Oct 2005 13:00:26 -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 99328-02 for ; Thu, 27 Oct 2005 16:00:24 +0000 (GMT) Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by svr1.postgresql.org (Postfix) with ESMTP id 9FB46DA743 for ; Thu, 27 Oct 2005 13:00:24 -0300 (ADT) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id DEE8F40D05D; Thu, 27 Oct 2005 17:00:11 +0100 (BST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id C270915EDA; Thu, 27 Oct 2005 16:56:54 +0100 (BST) Received: from mainbox.archonet.com ([127.0.0.1]) by localhost (mainbox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13353-08; Thu, 27 Oct 2005 16:56:50 +0100 (BST) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 4011715ED5; Thu, 27 Oct 2005 16:56:50 +0100 (BST) Message-ID: <4360F8C1.4040202@archonet.com> Date: Thu, 27 Oct 2005 16:56:49 +0100 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Sidar_L=F3pez_Cruz?= Cc: pgsql-performance@postgresql.org Subject: Re: how postgresql request the computer resources References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.058 required=5 tests=[AWL=0.008, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/424 X-Sequence-Number: 15192 Sidar L=F3pez Cruz wrote: > Is there something that tells postgres to take the resorces from=20 > computer (RAM, HDD, SWAP on linux) as it need, not modifying variables = > on postgresql.conf and other operating system things? Ah, and how is it to know what to share with other processes? > A days ago i am trying to show that postgres is better than mssql but=20 > when execute a simple query like: >=20 > (1) > select count(*) from > Total runtime: 134552.325 ms >=20 > (2) > select count(*) from fotos where archivo not in (select archivo from=20 > Total runtime: 26747.236 ms >=20 > (3) > select count(1) from fotos f where not exists (select a.archivo from=20 > Total runtime: 89765.714 ms >=20 > (4) > SELECT count(*) > Total runtime: 114893.116 ms > WITH ANY OF THIS QUERIES MSSQL TAKES NOT MUCH OF 7 SECONDS.... In which case they make a bad choice for showing PostgreSQL is faster=20 than MSSQL. Is this the only query you have, or are others giving you=20 problems too? I think count(*) is about the weakest point in PG, but I don't think=20 there'll be a general solution available soon. As I'm sure someone has=20 mentioned, whatever else, PG needs to check the row for its visibility=20 information. From the start of your email, you seem to suspect your configuration=20 needs some work. Once you are happy that your settings in general are=20 good, you can override some by issuing set statements before your query. = For example: SET work_mem =3D 10000; might well improve example #2 where you had a hash. -- Richard Huxton Archonet Ltd