Re: A sniffer for the buffer

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: autoramajj(at)hotmail(dot)com, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A sniffer for the buffer
Date: 2009-12-08 06:55:09
Message-ID: 4B1DF84D.2090308@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jonas J wrote:
> I took a look in the code again and made some changes. For the
> readBuffer im doing now:
> ReadBuffer(Relation reln, BlockNumber blockNum)
> fprintf(fp,"r%u\n",(unsigned int) blockNum); //as defined in
> header, typedef uint32 BlockNumber;
> and from the write pages:
> write_buffer(Buffer buffer, bool unpin){
> fprintf(fp,"w%d\n",BufferGetBlockNumber(buffer)); //get the
> blockNumber of this buffer
It's better to keep this discussion going on the list so you can get
alternate suggestions besides mine. The above is better. You're still
missing the relation number, which you're really going to want
eventually. And I think you're still vulnerable to printing the
information out before the block is locked properly in the write_buffer
case.

> So, I had never used DTrace, where can I find some good paper to start
> studying it ?? Also, do it work with linux, or only solaris ??
You can get it to work on Linux for PostgreSQL use if you use systemtap;
there's some people who've posted suggestions about that around.
> P.S.: I'm using PostgreSQL 8.1.4 to run with TPCC-UVA benchmarks tests...
Ah. PostgreSQL 8.1 is significantly slower than the current versions,
and you're not going to get as much help with issues related to the
source code as if you're using a newer one. For example, I don't know
the 8.1 buffer implementation code nearly as well because I didn't
really start tinkering with it until 8.2, so some of the things you're
asking about I don't have easy access or recollection of. Also, the
DTrace stuff is only really going to be helpful if you're starting with 8.4.

There may be some work to get TPCC-UVA working with 8.4 though,
particularly due to some changes made in 8.3 related to casting data to
other types. There is a TPC-C implementation that's used pretty often
by developers here named dbt-2: http://wiki.postgresql.org/wiki/DBT-2
that will work with a newer version.

--
Greg Smith 2ndQuadrant Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2009-12-08 07:24:04 Re: WAL format
Previous Message Heikki Linnakangas 2009-12-08 06:41:25 Re: WAL format