Re: Large data and slow queries

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Large data and slow queries
Date: 2017-04-19 04:42:03
Message-ID: dd56dc4e-04e2-1d75-e142-10ed8510377d@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 4/18/2017 9:01 PM, Samuel Williams wrote:
> We want the following kinds of query to be fast:
>
> SELECT ... AND (latitude > -37.03079375089291 AND latitude <
> -36.67086424910709 AND longitude > 174.6307139779924 AND longitude <
> 175.0805140220076);

I wonder if GIST would work better if you use the native POINT type, and
compared it like

mypoint <@ BOX
'((174.6307139779924,-37.03079375089291),(175.0805140220076,-36.67086424910709
))'

with a gist index on mypoint...

but, it all hinges on which clauses in your query are most selective,
thats where you want an index.

--
john r pierce, recycling bits in santa cruz

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Samuel Williams 2017-04-19 05:04:58 Re: Large data and slow queries
Previous Message Samuel Williams 2017-04-19 04:05:16 Re: Large data and slow queries