
Hackers

Here is the definition of relation_byte_size() in optimizer/path/costsize.c:

----------------------------------------------------------------------
/*
 * relation_byte_size
 *        Estimate the storage space in bytes for a given number of tuples
 *        of a given width (size in bytes).
 */
static double
relation_byte_size(double tuples, int width)
{
        return tuples * (MAXALIGN(width) + MAXALIGN(sizeof(HeapTupleData)));
}

----------------------------------------------------------------------

Shouldn't this be HeapTupleHeaderData and not HeapTupleData ? 

(Of course, from a costing perspective these shouldn't be very different but ...)

-- 
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh



Wed, 03 Dec 2003 15:30:02 -0800
Sailesh Krishnamurthy <sailesh@cs.berkeley.edu>
relation_byte_size()

Your patch has been added to the PostgreSQL unapplied patches list at:

	http://momjian.postgresql.org/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

---------------------------------------------------------------------------


Sailesh Krishnamurthy wrote:
> 
> Hackers
> 
> Here is the definition of relation_byte_size() in optimizer/path/costsize.c:
> 
> ----------------------------------------------------------------------
> /*
>  * relation_byte_size
>  *        Estimate the storage space in bytes for a given number of tuples
>  *        of a given width (size in bytes).
>  */
> static double
> relation_byte_size(double tuples, int width)
> {
>         return tuples * (MAXALIGN(width) + MAXALIGN(sizeof(HeapTupleData)));
> }
> 
> ----------------------------------------------------------------------
> 
> Shouldn't this be HeapTupleHeaderData and not HeapTupleData ? 
> 
> (Of course, from a costing perspective these shouldn't be very different but ...)
> 
> -- 
> Pip-pip
> Sailesh
> http://www.cs.berkeley.edu/~sailesh
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Mon, 15 Dec 2003 19:45:10 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: relation_byte_size()

Patch applied.  Thanks.

---------------------------------------------------------------------------


Sailesh Krishnamurthy wrote:
> 
> Hackers
> 
> Here is the definition of relation_byte_size() in optimizer/path/costsize.c:
> 
> ----------------------------------------------------------------------
> /*
>  * relation_byte_size
>  *        Estimate the storage space in bytes for a given number of tuples
>  *        of a given width (size in bytes).
>  */
> static double
> relation_byte_size(double tuples, int width)
> {
>         return tuples * (MAXALIGN(width) + MAXALIGN(sizeof(HeapTupleData)));
> }
> 
> ----------------------------------------------------------------------
> 
> Shouldn't this be HeapTupleHeaderData and not HeapTupleData ? 
> 
> (Of course, from a costing perspective these shouldn't be very different but ...)
> 
> -- 
> Pip-pip
> Sailesh
> http://www.cs.berkeley.edu/~sailesh
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Wed, 17 Dec 2003 22:46:58 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: relation_byte_size()