Re: Suggestion on index creation for TEXT data field

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: postgann2020 s <postgann2020(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>, pgsql-general <pgsql-general(at)postgresql(dot)org>, PostgreSQL mailing lists <pgsql-performance(at)postgresql(dot)org>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: Suggestion on index creation for TEXT data field
Date: 2020-05-21 14:36:39
Message-ID: CAKFQuwYtwQTZeX+buucq4gqSJwL7WQWxU7LvAJ1MEuzZa=KMrg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general pgsql-performance

On Thu, May 21, 2020 at 7:28 AM postgann2020 s <postgann2020(at)gmail(dot)com>
wrote:

> which is having an avg width of 149bytes.
>

The average is meaningless if your maximum value exceeds a limit.

2. What type of index is the best suited for this type of data?.
>

And what type of data exactly are we talking about. "TEXT" is not a useful
answer.

If the raw data is too large no index is going to be "best" - as the hint
suggests you either need to drop the idea of indexing the column altogether
or apply some function to the raw data and then index the result.

David J.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message postgann2020 s 2020-05-21 14:37:30 Suggestion on column cast automatically to data type
Previous Message postgann2020 s 2020-05-21 14:27:44 Suggestion on index creation for TEXT data field

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-05-21 14:41:37 Re: Suggestion on table analyze
Previous Message Rory Campbell-Lange 2020-05-21 14:35:59 Strategy for materialisation and centralisation of data

Browse pgsql-performance by date

  From Date Subject
Next Message Adrian Klaver 2020-05-21 14:41:37 Re: Suggestion on table analyze
Previous Message postgann2020 s 2020-05-21 14:27:44 Suggestion on index creation for TEXT data field