Re: Maximum size of the primary key

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jaanush(at)hot(dot)ee (Jass)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Maximum size of the primary key
Date: 2003-02-14 21:42:37
Message-ID: 11291.1045258957@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

jaanush(at)hot(dot)ee (Jass) writes:
> Is there a limit to the bytesize of the
> primary key? (I'm migrating from MySQL
> and there it was only 255).

btree index entries (primary key or not) are limited to 1/3 page, or
about 2700 bytes in a standard installation. In the case of
compressible types like text or varchar, compression can be applied
first, so you'd probably find you could get away with field widths
up to 4k or so. If you have entries wider than that, I'd begin to
question whether an index on the field really makes sense ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2003-02-14 21:45:42 Re: operators and bit field
Previous Message Jeff Eckermann 2003-02-14 21:38:27 Re: "iscachable" functions