Re: [GENERAL] B-tree index on a VARCHAR(4000) column - Mailing list pgsql-general

From Merlin Moncure
Subject Re: [GENERAL] B-tree index on a VARCHAR(4000) column
Date
Msg-id CAHyXU0xE_54MQxs-_jk84UxEHigFsBstPJNouv-yu=19Wi8_RQ@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] B-tree index on a VARCHAR(4000) column  (John Turner <fenwayriffs@gmail.com>)
Responses Re: [GENERAL] B-tree index on a VARCHAR(4000) column
List pgsql-general
On Friday, September 8, 2017, John Turner <fenwayriffs@gmail.com> wrote:


On Fri, Sep 8, 2017 at 6:57 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Ron Johnson <ron.l.johnson@cox.net> writes:
> 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)?

No.

So the declarative column length has no bearing on memory grants during plan generation/execution?

Nope.  Memory usage is proportional to the size of the string, not the maximum length for varchar.  Maximum length is a constraint.

merlin 

pgsql-general by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [GENERAL] pg_ident mapping Kerberos Usernames
Next
From: John Turner
Date:
Subject: Re: [GENERAL] B-tree index on a VARCHAR(4000) column