Re: What is impact of "varchar_opts"?

From: Edson Richter <edsonrichter(at)hotmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is impact of "varchar_opts"?
Date: 2013-01-21 20:12:06
Message-ID: BLU0-SMTP273E0E3A302CA4271424515CF170@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Em 21/01/2013 18:03, Tom Lane escreveu:
> Edson Richter <edsonrichter(at)hotmail(dot)com> writes:
>> I see. So, what is the overhead of having text_ops in opclass?
>> Can I define it as default for all my indexes when textual type of any kind?
> Why are you intent on defining anything? IMO, best practice is to let
> the database choose the opclass, unless you have a very good and
> specific reason to choose a non-default one for a particular index.
> Letting it default is way more future-proof than specifying something.
>
> regards, tom lane
>
>

Thanks, but I've found that some queries using LIKE operator uses table
scan instead index unless it is defined with varchar_ops in the index...

That make a huge difference when querying tables with millions of
objects (indexed vs table scan). And I can't avoid the LIKE operator...

Example:

select * from notafiscal where cnpj like '01234568%'

Is there other way I'm missing?

Thanks,

Edson

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2013-01-21 20:36:09 Re: What is impact of "varchar_opts"?
Previous Message Tim Uckun 2013-01-21 20:09:31 Re: Running update in chunks?