pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Yan Chunlu <springrider@gmail.com>
Cc: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: how could select id=xx so slow?
Date: Thu, 12 Jul 2012 14:56:29 +0800
Message-ID: <4FFE751D.3050105@ringerc.id.au> (raw)
In-Reply-To: <CAOA66tGY7K=3aPagXUsmFu+3YXn+5gmM7HvxvoPz7YSk-=6EWA@mail.gmail.com>
References: <CAOA66tEJLDOt4JpJ0RwOEsgizfQPWkCHd+SgT7kbiHix_io18A@mail.gmail.com>
	<D960CB61B694CF459DCFB4B0128514C2081BF021@exadv11.host.magwien.gv.at>
	<CAOA66tF8dAzAS9wG381bhp+AiC2LrzcF7MDmOxvgW0p07rMNtw@mail.gmail.com>
	<4FFB848D.7080900@ringerc.id.au>
	<CAOA66tEe4m8OQQ+26AKxrreEF458R-983UVMARZ6zeqEkZxwCQ@mail.gmail.com>
	<4FFB9781.60601@ringerc.id.au>
	<CAOA66tEiZ+OrU6mRutVq6Vksa6tRsgQYvB4erSNUpWx7t8LksQ@mail.gmail.com>
	<D960CB61B694CF459DCFB4B0128514C2082464D4@exadv11.host.magwien.gv.at>
	<CAOA66tE9PwbQ07+g9=HhbVwqXosy=Tb=M51NwSpoAmh5LvnVnw@mail.gmail.com>
	<4FFE17CF.1050601@ringerc.id.au>
	<CAOA66tF1M+S=m-7mU=TV91_hkxdcb1T8vwSwb-KRFOrdgBqWwA@mail.gmail.com>
	<4FFE346A.7030402@ringerc.id.au>
	<CAOA66tGY7K=3aPagXUsmFu+3YXn+5gmM7HvxvoPz7YSk-=6EWA@mail.gmail.com>

On 07/12/2012 01:10 PM, Yan Chunlu wrote:
> after check out the wiki page Maciek mentioned, turns out that heavy 
> connection also burden the disk hardly.
> looks like I am in the vicious circle:
> 1, slow query cause connection blocked so the client request more 
> connection.
> 2, more connection cause high disk io and make even the simplest query 
> slow and block.

While true, you can often control this by making sure you don't 
completely overload your hardware, queuing queries instead of running 
them all at once.

You may still discover that your hardware can't cope with the workload 
in that your queues may just keep on getting deeper or time out. In that 
case, you certainly need to optimise your queries, tune your database, 
and/or get bigger hardware.

--
Craig Ringer

view thread (25+ messages)  latest in thread

Message-ID: <4FFE751D.3050105@ringerc.id.au>
Permalink:  ../4FFE751D.3050105@ringerc.id.au/
Also on:    postgresql.org/message-id/4FFE751D.3050105@ringerc.id.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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: ringerc@ringerc.id.au, springrider@gmail.com, laurenz.albe@wien.gv.at
  Subject: Re: how could select id=xx so slow?
  In-Reply-To: <4FFE751D.3050105@ringerc.id.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