pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dan Harris <fbsd@drivefaster.net>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: Simple query showing 270 hours of CPU time
Date: Fri, 20 Jul 2007 12:42:05 -0400
Message-ID: <10727.1184949725@sss.pgh.pa.us> (raw)
In-Reply-To: <46A0D836.5090806@drivefaster.net>
References: <46A0D836.5090806@drivefaster.net>

Dan Harris <fbsd@drivefaster.net> writes:
> Here's the strace summary as run for a few second sample:

> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>   97.25    0.671629          92      7272           semop
>    1.76    0.012171         406        30           recvfrom
>    0.57    0.003960          66        60           gettimeofday
>    0.36    0.002512          28        90           sendto
>    0.05    0.000317          10        32           lseek
>    0.01    0.000049           1        48           select
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.690638                  7532           total

> Here's the query:
> select id from eventkeywords where word = '00003322'

How sure are you that (a) that's really what it's doing and (b) you are
not observing multiple executions of the query?  There are no recvfrom
calls in the inner loops of the backend AFAIR, so this looks to me like
the execution of 30 different queries.  The number of semops is
distressingly high, but that's a contention issue not an
amount-of-runtime issue.  I think you're looking at a backend that has
simply executed one heckuva lot of queries on behalf of its client,
and that inquiring into what the client thinks it's doing might be the
first order of business.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <10727.1184949725@sss.pgh.pa.us>
Permalink:  ../10727.1184949725@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10727.1184949725@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, fbsd@drivefaster.net
  Subject: Re: Simple query showing 270 hours of CPU time
  In-Reply-To: <10727.1184949725@sss.pgh.pa.us>

* 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