Can simplify 'limit 1' with slow function?

Поиск
Список
Период
Сортировка
От gotoschool6g
Тема Can simplify 'limit 1' with slow function?
Дата
Msg-id 53B01D39.1050009@gmail.com
обсуждение исходный текст
Ответы Re: Can simplify 'limit 1' with slow function?  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-hackers
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, ST_GeomFromText('POINT(1 1)')) from road order by c limit 1;
is slow than:
select ST_Distance_Sphere(s, ST_GeomFromText('POINT(1 1)')) from (SELECT s from road order by c limit 1) as a;
There are about 7000 records in 'road'.  

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Escaping from blocked send() reprised.
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Set new system identifier using pg_resetxlog