substring index what is better way to query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux