public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tieson Molly <[email protected]>
To: [email protected]
Subject: substring index what is better way to query
Date: Tue, 20 Jun 2017 07:51:06 -0400
Message-ID: <CADPSLQaAGZ6jxDhqmv2k5YcLiLXPSfdEU7c9wBEAQT40YAsH2w@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgsql-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


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: substring index what is better way to query
  In-Reply-To: <CADPSLQaAGZ6jxDhqmv2k5YcLiLXPSfdEU7c9wBEAQT40YAsH2w@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox