finding out actual tuple size

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Linh Luong

    finding out actual tuple size

    Hi All,

    1. I have been reading and the max size of a tuple is 8K.
    I have also read that I can it to a larger size in some config file. Where is
    this file? is it called pg_config.h and is the variable called BLKSZ??

    2. Is there a way I can find the actual size of the tuple? Do you go into each
    column and find the length of each value and sum it up? I am out of ideas..

    if someone knows how please shine some light on my situation..

    thanks

    --------------------------------
    Linh Luong


    ---------------------------(end of broadcast)---------------------------
    TIP 9: the planner will ignore your desire to choose an index scan if your
    joining column's datatypes do not match

  • Andrew Sullivan

    #2
    Re: finding out actual tuple size

    On Tue, Feb 17, 2004 at 03:39:25PM -0700, Linh Luong wrote:[color=blue]
    > Hi All,
    >
    > 1. I have been reading and the max size of a tuple is 8K.[/color]

    That hasn't been true for ages. Use a newer PostgreSQL; any modern
    one will have the TOAST capability and won't have this limitation.

    A

    --
    Andrew Sullivan

    ---------------------------(end of broadcast)---------------------------
    TIP 3: if posting/reading through Usenet, please send an appropriate
    subscribe-nomail command to majordomo@postg resql.org so that your
    message can get through to the mailing list cleanly

    Comment

    • scott.marlowe

      #3
      Re: finding out actual tuple size

      On Tue, 17 Feb 2004, Linh Luong wrote:
      [color=blue]
      > Hi All,
      >
      > 1. I have been reading and the max size of a tuple is 8K.
      > I have also read that I can it to a larger size in some config file. Where is
      > this file? is it called pg_config.h and is the variable called BLKSZ??[/color]

      You'd have to set the way back machine for a couple years ago to run into
      the 8k block size limit. If someone recently told you this to steer you
      away from Postgresql their knowledge is quite old, and anything they tell
      you about anything since, say, the first gulf war should be viewed with
      suspicion :-)

      the maximum size of an idividual FIELD in a row is about 2 gigabytes.
      Since text may be multi-byte, it's a good idea to call it 1 gig (of
      characters) for text and you're gold.
      [color=blue]
      > 2. Is there a way I can find the actual size of the tuple? Do you go into each
      > column and find the length of each value and sum it up? I am out of ideas..[/color]

      Why would you need to know an idividual tuple size? There's a bit of
      extra data for each field, but generally if the size of the data in the
      field is 1k or more, you're not likely to notice the overhead Postgresql
      is producing.

      Each tuple uses about 30 some bytes, (I could be way off there, it might
      be bits.) then each field uses another byte or two to keep track of
      things like the size of the field etc on top of the actual data it stores.


      ---------------------------(end of broadcast)---------------------------
      TIP 7: don't forget to increase your free space map settings

      Comment

      • Tom Lane

        #4
        Re: finding out actual tuple size

        Andrew Sullivan <ajs@crankycanu ck.ca> writes:[color=blue]
        > On Tue, Feb 17, 2004 at 03:39:25PM -0700, Linh Luong wrote:[color=green]
        >> 1. I have been reading and the max size of a tuple is 8K.[/color][/color]
        [color=blue]
        > That hasn't been true for ages. Use a newer PostgreSQL; any modern
        > one will have the TOAST capability and won't have this limitation.[/color]

        Actually it is still true, but with TOAST compression available for
        individual columns it hardly ever matters anymore. If you have enough
        columns in your table to be running afoul of the limit, you probably
        oughta be thinking about a redesign of your database schema anyway.

        But for the record: BLCKSZ is the thing to poke if you really must.

        regards, tom lane

        ---------------------------(end of broadcast)---------------------------
        TIP 6: Have you searched our list archives?



        Comment

        Working...