pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Saleem Burhani Baloch <peseek@khi.wol.net.pk>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow response of PostgreSQL
Date: Tue, 17 Feb 2004 14:59:08 +0800
Message-ID: <4031BBBC.5050002@familyhealth.com.au> (raw)
In-Reply-To: <200402170624.i1H6O2u16022@ns2.khi.wol.net.pk>
References: <200402170624.i1H6O2u16022@ns2.khi.wol.net.pk>

> 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




view thread (18+ messages)  latest in thread

Message-ID: <4031BBBC.5050002@familyhealth.com.au>
Permalink:  ../4031BBBC.5050002@familyhealth.com.au/
Also on:    postgresql.org/message-id/4031BBBC.5050002@familyhealth.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: chriskl@familyhealth.com.au, peseek@khi.wol.net.pk
  Subject: Re: Slow response of PostgreSQL
  In-Reply-To: <4031BBBC.5050002@familyhealth.com.au>
  References: <200402170624.i1H6O2u16022@ns2.khi.wol.net.pk> <4031BBBC.5050002@familyhealth.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox