pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laszlo Nagy <gandalf@shopzeus.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Florian Weimer <fweimer@bfk.de>
Cc: Daniel Fekete <danieleff@gmail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: Slow query + why bitmap index scan??
Date: Wed, 12 Jan 2011 16:20:26 +0100
Message-ID: <4D2DC6BA.3000400@shopzeus.com> (raw)
In-Reply-To: <4D2D68270200002500039327@gw.wicourts.gov>
References: <4D2D9B1E.7080302@shopzeus.com>
	<82y66qp7al.fsf@mid.bfk.de>
	<4D2DB8F9.9050609@shopzeus.com>
	<4D2D68270200002500039327@gw.wicourts.gov>

On 2011-01-12 15:36, Kevin Grittner wrote:
> Laszlo Nagy<gandalf@shopzeus.com>  wrote:
>
>> shared_mem = 6GB
>> work_mem = 512MB
>> total system memory=24GB
>
> In addition to the good advice from Ken, I suggest that you set
> effective_cache_size (if you haven't already).  Add whatever the OS
> shows as RAM used for cache to the shared_mem setting.
It was 1GB. Now I changed to 2GB. Although the OS shows 9GB inactive 
memory, we have many concurrent connections to the database server. I 
hope it is okay to use 2GB.
>
> But yeah, for your immediate problem, if you can cluster the table
> on the index involved, it will be much faster.  Of course, if the
> table is already in a useful order for some other query, that might
> get slower, and unlike some other products, CLUSTER in PostgreSQL
> doesn't *maintain* that order for the data as new rows are added --
> so this should probably become a weekly (or monthly or some such)
> maintenance operation.
Thank you! After clustering, queries are really fast. I don't worry 
about other queries. This is the only way we use this table - get 
details for a given id value. I put the CLUSTER command into a cron 
script that runs daily. For the second time, it took 2 minutes to run so 
I guess it will be fine.

Thank you for your help.

    Laszlo




view thread (8+ messages)  latest in thread

Message-ID: <4D2DC6BA.3000400@shopzeus.com>
Permalink:  ../4D2DC6BA.3000400@shopzeus.com/
Also on:    postgresql.org/message-id/4D2DC6BA.3000400@shopzeus.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: gandalf@shopzeus.com, Kevin.Grittner@wicourts.gov, fweimer@bfk.de, danieleff@gmail.com
  Subject: Re: Slow query + why bitmap index scan??
  In-Reply-To: <4D2DC6BA.3000400@shopzeus.com>

* 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