Fascinating.
On Fri, Jul 04, 2014 at 10:47:06AM +0800, gotoschool6g wrote:
slow query(8531 ms):
SELECT ST_Distance_Sphere(shape,ST_GeomFromText('POINT(116.41386186784513
40.12211338311868)')) FROM road order by id LIMIT 1;
explain output:
Limit (cost=4653.48..4653.48 rows=1 width=3612)
slow query(8531 ms):
SELECT ST_Distance_Sphere(shape,ST_GeomFromText('POINT(116.41386186784513
40.12211338311868)')) FROM road order by id LIMIT 1;
explain output:
Limit (cost=4653.48..4653.48 rows=1 width=3612)
- Sort (cost=4653.48..4683.06 rows=11832 width=3612)
Sort Key: id
On Tue, Jul 01, 2014 at 02:36:55PM -0500, Merlin Moncure wrote:
On Tue, Jul 1, 2014 at 2:16 PM, Martijn van Oosterhout
klep...@svana.org wrote:
On Sun, Jun 29, 2014 at 10:05:50PM +0800, gotoschool6g wrote:
The simplified scene:
select slowfunction(s) from a order by b limit 1;
is slow
Martijn van Oosterhout wrote
On Tue, Jul 01, 2014 at 02:36:55PM -0500, Merlin Moncure wrote:
On Tue, Jul 1, 2014 at 2:16 PM, Martijn van Oosterhout
lt;
kleptog@
gt; wrote:
On Sun, Jun 29, 2014 at 10:05:50PM +0800, gotoschool6g wrote:
The simplified scene:
select slowfunction(s) from a
David G Johnston david.g.johns...@gmail.com writes:
Martijn van Oosterhout wrote
I'm probably dense, but I'm not sure I understand. Or it is that the
slowfunction() is called prior to the sort? That seems insane.
The basic reality is that limit applies to the final set of rows that could
be
On Wed, Jul 02, 2014 at 04:17:13PM -0400, Tom Lane wrote:
David G Johnston david.g.johns...@gmail.com writes:
Martijn van Oosterhout wrote
I'm probably dense, but I'm not sure I understand. Or it is that the
slowfunction() is called prior to the sort? That seems insane.
The basic
Martijn van Oosterhout klep...@svana.org writes:
On Wed, Jul 02, 2014 at 04:17:13PM -0400, Tom Lane wrote:
It's not so much the limit as that the sort has to happen before the
limit, and yes, evaluation of the targetlist happens before the sort.
I guess I assumed the column c was indexable,
The simplified scene:
select slowfunction(s) from a order by b limit 1;
is slow than
select slowfunction(s) from (select s from a order by b limit 1) as z;
if there are many records in table 'a'.
The real scene. Function ST_Distance_Sphere is slow, the query:
SELECT ST_Distance_Sphere(s,
On Sun, Jun 29, 2014 at 10:05:50PM +0800, gotoschool6g wrote:
The simplified scene:
select slowfunction(s) from a order by b limit 1;
is slow than
select slowfunction(s) from (select s from a order by b limit 1) as z;
if there are many records in table 'a'.
The real scene. Function
On Tue, Jul 1, 2014 at 2:16 PM, Martijn van Oosterhout
klep...@svana.org wrote:
On Sun, Jun 29, 2014 at 10:05:50PM +0800, gotoschool6g wrote:
The simplified scene:
select slowfunction(s) from a order by b limit 1;
is slow than
select slowfunction(s) from (select s from a order by b limit 1)
Merlin Moncure-2 wrote
On Tue, Jul 1, 2014 at 2:16 PM, Martijn van Oosterhout
lt;
kleptog@
gt; wrote:
On Sun, Jun 29, 2014 at 10:05:50PM +0800, gotoschool6g wrote:
The simplified scene:
select slowfunction(s) from a order by b limit 1;
is slow than
select slowfunction(s) from (select s
On Tue, Jul 1, 2014 at 3:06 PM, David G Johnston
david.g.johns...@gmail.com wrote:
Merlin Moncure-2 wrote
On Tue, Jul 1, 2014 at 2:16 PM, Martijn van Oosterhout
lt;
kleptog@
gt; wrote:
On Sun, Jun 29, 2014 at 10:05:50PM +0800, gotoschool6g wrote:
The simplified scene:
select
12 matches
Mail list logo