Re: B-tree index on a VARCHAR(4000) column

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: B-tree index on a VARCHAR(4000) column
Date: 2017-09-08 12:50:39
Message-ID: CAHyXU0wFT+X=CGi+ONQVRxhfGPheiU=Fh6JOZUae-KBcgQi5Lw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 7, 2017 at 10:48 PM, Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> wrote:
> Hi,
>
> v 9.2.7
>
> Based on LENGTH(offending_column), none of the values are more than 144
> bytes in this 44.2M row table. Even though VARCHAR is, by definition,
> variable length, are there any internal design issues which would make
> things more efficient if it were dropped to, for example, VARCHAR(256)?
>
> (I don't have access to the source code or to development boxes, so can't
> just test this on my own.)

Just use TEXT :-). Realizing that obsessing about column lengths was
a giant waste of time and energy for zero useful benefit that I've
ever observed was a transformational moment for me. Also, please
apply bugfix upgrades :-).

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message chiru r 2017-09-08 19:34:10 SAP Application deployment on PostgreSQL
Previous Message Tom Lane 2017-09-08 11:56:12 Re: B-tree index on a VARCHAR(4000) column