[PERFORM] substring index what is better way to query - Mailing list pgsql-performance

From Tieson Molly
Subject [PERFORM] substring index what is better way to query
Date
Msg-id CADPSLQaAGZ6jxDhqmv2k5YcLiLXPSfdEU7c9wBEAQT40YAsH2w@mail.gmail.com
Whole thread Raw
Responses Re: [PERFORM] substring index what is better way to query
List pgsql-performance
Good morning,

I have an index I created on the prefix of a column:

create index location_geo_idx ON locations( substring(geohash, 0, 5));

I currently use a similar to query, but I wanted to know if there is a faster way to query multiple value using this index than this?

select l.geohash from locations l where l.geohash similar to '(dr7g|dr7e)%';

My goal is to utilize 9 values each time for the geohash adjacent squares.

Best regards,

Ty

pgsql-performance by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [PERFORM] Using array instead of sub table (storage and speed)
Next
From: Tom Lane
Date:
Subject: Re: [PERFORM] substring index what is better way to query