pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Siddharth Anand <sid@etsy.com>
To: pgsql-performance@postgresql.org
Subject: [Fwd: ] How
Date: Fri, 27 Apr 2007 08:30:51 -0700 (PDT)
Message-ID: <50431.209.51.183.100.1177687851.squirrel@mailbox.etsy.com> (raw)

Hi!
I read the link below and am puzzled by or curious about something.
http://www.postgresql.org/docs/8.1/interactive/datatype-character.html

The Tip below is intriguing

"Tip:  There are no performance differences between these three types,
apart from the increased storage size when using the blank-padded type.
While character(n) has performance advantages in some other database
systems, it has no such advantages in PostgreSQL. In most situations text
or character varying should be used instead."

How can a field that doesn't have a limit like "text" perform similarly to
char varying(128), for example? At some point, we need to write data to
disk. The more data that needs to be written, the longer the disk write
will take, especially when it requires finding free sectors to write to.

Another interesting quote from the same page is the following:

"Long values are also stored in background tables so they do not interfere
with rapid access to the shorter column values. "

If the long values are stored in a separate table, on a different part of
the disk, doesn't this imply an extra disk seek? Won't it therefore take
longer?


Sid








view thread (2+ messages)  latest in thread

Message-ID: <50431.209.51.183.100.1177687851.squirrel@mailbox.etsy.com>
Permalink:  ../50431.209.51.183.100.1177687851.squirrel@mailbox.etsy.com/
Also on:    postgresql.org/message-id/50431.209.51.183.100.1177687851.squirrel@mailbox.etsy.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sid@etsy.com
  Subject: Re: [Fwd: ] How
  In-Reply-To: <50431.209.51.183.100.1177687851.squirrel@mailbox.etsy.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox