Re: Help understanding indexes - Mailing list pgsql-general

From Tom Lane
Subject Re: Help understanding indexes
Date
Msg-id 10290.1023897512@sss.pgh.pa.us
Whole thread Raw
In response to Re: Help understanding indexes  (chris.gamble@CPBINC.com)
List pgsql-general
chris.gamble@CPBINC.com writes:
> Heres the one with the float8's with an explain.

> SELECT * FROM tdatcustomerlist WHERE float8gt(longitude,-87.09486892480946)
> AND float8lt(longitude, -87.05713307519055) AND float8gt(latitude,
> 31.095787219971054) AND float8lt(latitude, 31.124730780028944)

Try writing it in a more natural fashion:

SELECT * FROM tdatcustomerlist WHERE longitude > -87.09486892480946
AND longitude < -87.05713307519055 AND latitude > 31.095787219971054
AND latitude < 31.124730780028944

The optimizer doesn't try to do anything with function calls, only with
operators.

            regards, tom lane

pgsql-general by date:

Previous
From: "Paulo Sergio Fernandes Parola (Keyword)"
Date:
Subject: JOIN performance + exporting/importing text files (how to do bett er than with \copy?)
Next
From: Jorge Sarmiento
Date:
Subject: optimizing SELECT with LIKE