Re: Caching number of blocks in relation to avoi lseek.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Denis Perchine <dyp(at)perchine(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Caching number of blocks in relation to avoi lseek.
Date: 2000-06-13 02:34:41
Message-ID: 6002.960863681@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Denis Perchine <dyp(at)perchine(dot)com> writes:
> No... You did not get me. I am talking about completly different thing:
> I strace'ed postgres binary when doing queries and found out that it
> do lseek after each read, and the difference in the position is 8096.
> It means that we are in correct position anyway and do not need additional lseek.

Oh. Hmm. Not sure if it's really worth the trouble, but you could try
having fd.c keep track of the current seek position of VFDs when they
are open as well as when they are closed, and optimize away the lseek
call in FileSeek if the position is already right. You'd have to think
carefully about what to do if a read or write fails, however --- where
has the kernel left its seek position in that case? Possibly this could
be dealt with by setting the internal position to "unknown" anytime
we're not perfectly sure where the kernel is.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-06-13 02:41:52 Re: memory management suggestion
Previous Message Tom Lane 2000-06-13 02:30:20 Re: Proposal for fixing intra-query memory leaks

Browse pgsql-patches by date

  From Date Subject
Next Message Alfred Perlstein 2000-06-13 03:01:48 Re: Caching number of blocks in relation to avoi lseek.
Previous Message Denis Perchine 2000-06-13 00:52:45 Re: Caching number of blocks in relation to avoi lseek.