Re: PostgreSQL 9.0.4 blocking in lseek? - Mailing list pgsql-performance

From Tom Lane
Subject Re: PostgreSQL 9.0.4 blocking in lseek?
Date
Msg-id 9398.1319761978@sss.pgh.pa.us
Whole thread Raw
In response to PostgreSQL 9.0.4 blocking in lseek?  (Sören Meyer-Eppler <soerenme@google.com>)
Responses Re: PostgreSQL 9.0.4 blocking in lseek?  (Sören Meyer-Eppler <soerenme@google.com>)
Re: PostgreSQL 9.0.4 blocking in lseek?  (Matteo Beccati <php@beccati.com>)
List pgsql-performance
=?ISO-8859-1?Q?S=F6ren_Meyer-Eppler?= <soerenme@google.com> writes:
> A fairly complex insert query on an empty destination table will run for
> an indefinite amount of time (we waited literally days for the query to
> complete). This does not happen every time we run the query but often.
> Now ordinarily I'd assume we did something wrong with our indices or
> query, but the execution plan looks sane and, more tellingly, we have:
> - no CPU load
> - no network traffic
> - no disk I/O
> - no other load on the server except this single query
> and strace displaying a seemingly endless list of lseek calls.

> So my assumption is that we are not running into bad Big-O() runtime
> behavior but rather into some locking problem.

If it were blocked on a lock, it wouldn't be doing lseeks().

The most obvious explanation for a backend that's doing repeated lseeks
and nothing else is that it's repeatedly doing seqscans on a table
that's fully cached in shared buffers.  I'd wonder about queries
embedded in often-executed plpgsql functions, for instance.  Can you
identify which table the lseeks are issued against?

(Now, having said that, I don't see how that type of theory explains no
CPU load.  But you're really going to need to provide more info before
anyone can explain it, and finding out what the lseeks are on would be
one good step.)

            regards, tom lane

pgsql-performance by date:

Previous
From: Samuel Gendler
Date:
Subject: Re: backups blocking everything
Next
From: Josh Berkus
Date:
Subject: Re: PostgreSQL 9.0.4 blocking in lseek?