Re: Performance of the listen command - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Performance of the listen command
Date
Msg-id 20060729024304.GA45736@winnie.fuhr.org
Whole thread Raw
In response to Re: Performance of the listen command  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Performance of the listen command  (Flemming Frandsen <ff@partyticket.net>)
List 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

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Performance of the listen command
Next
From: Flemming Frandsen
Date:
Subject: Re: Performance of the listen command