postgres 8.4.4 on openSUSE 11.3 (2.6.36rc7, x86_64).

I was watching a fairly large query run and observed that the disk
light went out. I checked 'top' and postgres was using 100% CPU so I
strace'd the running process.
This is what I saw:

lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(87, 0, SEEK_END)                  = 585531392
lseek(94, 270680064, SEEK_SET)          = 270680064
read(94, "<elided>"..., 8192) = 8192

and I observed that pattern quite a bit.

I know lseek is cheap, but a superfluous systemcall is a superfluous
systemcall, and over a short period amounted to 37% (according to
strace) of the time spent in the system.

What's with the excess calls to lseek?

The query plan was a nested loop anti-join (on purpose).

-- 
Jon

-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

Reply via email to