Re: [EXTERNAL] Re: BUG #16835: btree index does not work for where clause using 'foo%'

From: luis(dot)roberto(at)siscobra(dot)com(dot)br
To: "Zhang, Hongyan" <ZhangH3(at)aetna(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: [EXTERNAL] Re: BUG #16835: btree index does not work for where clause using 'foo%'
Date: 2021-01-22 19:23:37
Message-ID: 848323852.1456269.1611343417560.JavaMail.zimbra@siscobra.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

De: "Zhang, Hongyan" <ZhangH3(at)aetna(dot)com>
Para: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-bugs" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Enviadas: Sexta-feira, 22 de janeiro de 2021 16:07:22
Assunto: Re: [EXTERNAL] Re: BUG #16835: btree index does not work for where clause using 'foo%'

Thanks, Tom.

Locale is en_US.UTF-8.

Is there plan to alter that behavior to allow index in non C locale?

According to documentation: " However, if your database does not use the C locale you will need to create the index with a special operator class to support indexing of pattern-matching queries;"

So you'll have to create the index with a specific operator class.

You can use:.

CREATE INDEX tbl_col_text_pattern_ops_idx ON tbl(col text_pattern_ops) [1]

[1] https://stackoverflow.com/questions/1566717/postgresql-like-query-performance-variations

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Zhang, Hongyan 2021-01-22 19:45:53 Re: [EXTERNAL] Re: BUG #16835: btree index does not work for where clause using 'foo%'
Previous Message Zhang, Hongyan 2021-01-22 19:07:22 Re: [EXTERNAL] Re: BUG #16835: btree index does not work for where clause using 'foo%'