Re: Slow response of PostgreSQL

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: Saleem Burhani Baloch <peseek(at)khi(dot)wol(dot)net(dot)pk>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Slow response of PostgreSQL
Date: 2004-02-17 06:59:08
Message-ID: 4031BBBC.5050002@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephan Szabo 2004-02-17 07:42:48 Re: Slow response of PostgreSQL
Previous Message Saleem Burhani Baloch 2004-02-17 06:24:02 Slow response of PostgreSQL