X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 682C0D1D29D for ; Tue, 17 Feb 2004 06:54:16 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 38451-03 for ; Tue, 17 Feb 2004 02:54:06 -0400 (AST) Received: from houston.familyhealth.com.au (fhnet.arach.net.au [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id 0D9FCD1CACD for ; Tue, 17 Feb 2004 02:54:04 -0400 (AST) Received: from familyhealth.com.au (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9p1/8.12.9) with ESMTP id i1H6re4v049314; Tue, 17 Feb 2004 14:53:40 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <4031BBBC.5050002@familyhealth.com.au> Date: Tue, 17 Feb 2004 14:59:08 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Saleem Burhani Baloch Cc: pgsql-performance@postgresql.org Subject: Re: Slow response of PostgreSQL References: <200402170624.i1H6O2u16022@ns2.khi.wol.net.pk> In-Reply-To: <200402170624.i1H6O2u16022@ns2.khi.wol.net.pk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/175 X-Sequence-Number: 5699 > select count(*), sum(vl_ex_stax) , sum(qty) , unit from inv_detail group by unit; > on both databases. > > PostgreSQL return result in 50 sec every time. > MS-SQL return result in 2 sec every time. > My PostgreSQL Conf is > ********************* > log_connections = yes > syslog = 2 > effective_cache_size = 327680 > sort_mem = 10485760 > max_connections = 64 > shared_buffers = 512 > wal_buffers = 1024 This is a shockingly bad postgresql.conf. I'm not surprised you have performance problems. Change this: effective_cache_size = 4000 sort_mem = 4096 shared_buffers = 1000 wal_buffers = 8 Also, you need a LOT more RAM in your PostgreSQL machine, at least half a gig for a basic database server. > 1- How can I lock a single record so that other users can only read it. ?? You cannot do that in PostgreSQL. > 2- one user executes a query it will be process and when another user executes the same query having the same result should not again go for processing. The result should be come from the cache. Is this possible in postgres ?? No, implement it in your application. Prepared queries and stored procedures might help you here. Chris