Re: R: Index on integer or on string field

From: Arthur Silva <arthurprs(at)gmail(dot)com>
To: Job <Job(at)colliniconsulting(dot)it>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: R: Index on integer or on string field
Date: 2015-05-15 17:32:23
Message-ID: CAO_YK0Uv+KEnGgVNCkCUa+VD+gr=ic1m7O1_pSNdEqb5c8ru=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yes that's my suggestion. Btree-Gin deals with lots of repeated values much
better than the Btree index as repeated keys are only stored once.
Em 15/05/2015 12:38, "Job" <Job(at)colliniconsulting(dot)it> escreveu:

> Hello Arthur!
>
> So, i read that btree-gin have got "the ability to enforce uniqueness".
>
> If in this 10.millions long table i have, in index, 50 recurring values, i
> can leave the alphabetical field and change to btree-gin the index on it?!
>
> Thank you!
> Francesco
>
> ------------------------------
> *Da:* Arthur Silva [arthurprs(at)gmail(dot)com]
> *Inviato:* venerdì 15 maggio 2015 17.26
> *A:* Job
> *Cc:* pgsql-general(at)postgresql(dot)org
> *Oggetto:* Re: [GENERAL] Index on integer or on string field
>
> You should probably experiment with a btree-gin index on those.
> Em 15/05/2015 12:22, "Job" <Job(at)colliniconsulting(dot)it> escreveu:
>
>> Hello,
>>
>> i have a table of about 10 millions of records, with the index on a
>> string field.
>> Actually is alphabetical; since queries are about 100/200 per seconds, i
>> was looking for a better way to improve performance and reduce workload.
>>
>> The unique values, of that fields, are about the 50 (category name), and
>> we could create a second table to codify, with numerical integer values,
>> the 50 recurring names.
>>
>> Is index are integer and not characteral, performance are better and
>> workload reduces?
>>
>> Is there any comparisons?
>>
>> Thank you!
>> Francesco
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Begin 2015-05-15 19:17:03 Re: Restarting DB after moving to another drive
Previous Message Francisco Olarte 2015-05-15 16:19:53 Re: Restarting DB after moving to another drive