Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

text_pattern_ops index on public.blocks.key #68

Open
i-norden opened this issue Oct 22, 2020 · 0 comments
Open

text_pattern_ops index on public.blocks.key #68

i-norden opened this issue Oct 22, 2020 · 0 comments

Comments

@i-norden
Copy link
Collaborator

i-norden commented Oct 22, 2020

Our Postgres servers are very likely not configured with the "C" locale (but rather "UTF-8'), in which case the default operator class for the btree index on a TEXT column is not optimized for pattern matching expressions (e.g. LIKEs, prefix scans).

E.g. CREATE INDEX IF NOT EXISTS blocks_key_text_pattern_ops_idx ON public.blocks (key text_pattern_ops)

We may want to leave the existing btree index on key (from its UNIQUE NOT NULL constraint), as the default operator class index is optimized for ordinary <, <=, >, or >= comparisons.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant