[HACKERS] Can simplify 'limit 1' with slow function?

2014-07-01 Thread gotoschool6g
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,

Re: [HACKERS] Can simplify 'limit 1' with slow function?

2014-07-03 Thread gotoschool6g
) WITH ( OIDS=FALSE ); There are redundant call when sorting? 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

Re: [HACKERS] pg_xlogdump --stats

2014-07-04 Thread gotoschool6g
I'm pretty sure that most committers would want to apply the rm_identity part in a separate commit first. Could you make it two patches, one introducing rm_identity, and another with xlogdump using it? Carp the code: const char * clog_identify(uint8 info) { switch (info) {