Skip site navigation (1) Skip section navigation (2)

Re: Reduce heap tuple header size

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Manfred Koizar <mkoi-pg(at)aon(dot)at>,pgsql-patches(at)postgresql(dot)org
Subject: Re: Reduce heap tuple header size
Date: 2002-06-21 14:25:32
Message-ID: 200206211425.g5LEPWB16490@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Jan Wieck wrote:
> Tom Lane wrote:
> > 
> > Jan Wieck <JanWieck(at)Yahoo(dot)com> writes:
> > > Do we have any hard numbers on that? Is it just access to the header
> > > fields, or do we loose the offset cacheability of all fixed size fields
> > > at the beginning of a row? In the latter case count me into the
> > > slowness-believer camp.
> > 
> > I don't believe the patch would have made the header variable size,
> > only changed what the fixed size is.  The slowdown I was worried about
> > was just a matter of a couple extra tests and branches in the tqual.c
> > routines; which would be negligible if they weren't such hotspots.
> 
> Did someone run at least pgbench with/without that patch applied?

No, but he did perform this analysis:

> thus reducing the additional cost to one t_infomask compare,
> because the Satisfies functions only access Cmin and Cmax,
> when HEAP_MOVED is known to be not set.
> 
> OTOH experimenting with a moderatly sized "out of production"
> database I got the following results:
>                          | pages | pages |
> relkind | count | tuples | before| after | savings
> --------+-------+--------+-------+-------+--------
> i       |    31 | 808146 |  8330 |  8330 |   0.00%
> r       |    32 | 612968 | 13572 | 13184 |   2.86%
> all     |    63 |        | 21902 | 21514 |   1.77%
> 
> 2.86% fewer heap pages mean 2.86% less disk IO caused by heap pages.
> Considering that index pages tend to benefit more from caching
> we conclude that heap pages contribute more to the overall
> IO load, so the total savings in the number of disk IOs should
> be better than the 1.77% shown in the table above.  I think
> this outweighs a few CPU cycles now and then.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2002-06-21 14:47:20
Subject: Re: What is wrong with hashed index usage?
Previous:From: Bruce MomjianDate: 2002-06-21 14:15:03
Subject: Re: Our archive searching stinks

pgsql-patches by date

Next:From: Tom LaneDate: 2002-06-21 15:39:45
Subject: Re: Reduce heap tuple header size
Previous:From: Bruce MomjianDate: 2002-06-21 14:18:10
Subject: Re: contrib/DBMirror

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group