Re: Performance of the listen command

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Flemming Frandsen <ff(at)partyticket(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Performance of the listen command
Date: 2006-07-29 02:43:04
Message-ID: 20060729024304.GA45736@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 28, 2006 at 10:09:00PM -0400, Alvaro Herrera wrote:
> Flemming Frandsen wrote:
> > The strange thing is that just about any query runs in 1-4ms, but the
> > listen command, which shouldn't even have to touch the disk takes around
> > 60ms.
>
> Actually, it does write to disk, because the listen information is kept
> on a table.

Also, based on a 60ms-per-listen time I suspect you're not doing
the listens in a transaction, so each listen is its own transaction
that has to be committed, resulting in a disk hit. Try doing them
all in one transaction.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Flemming Frandsen 2006-07-29 10:44:14 Re: Performance of the listen command
Previous Message Alvaro Herrera 2006-07-29 02:09:00 Re: Performance of the listen command