Re: [HACKERS] 6.5 beta and ORDER BY patch - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: [HACKERS] 6.5 beta and ORDER BY patch
Date
Msg-id 36B82226.546962DE@trust.ee
Whole thread Raw
In response to Re: [HACKERS] 6.5 beta and ORDER BY patch  (jwieck@debis.com (Jan Wieck))
Responses Re: [HACKERS] 6.5 beta and ORDER BY patch  (jwieck@debis.com (Jan Wieck))
List pgsql-hackers
Jan Wieck wrote:
> 
> >
> > Hi PostgreSQL hackers
> >
> > As we are again approaching the beta (feature freeze),
> > I will ask my ordinary question ;)
> >
> > Is the patch by Jan that eliminated the duplicate sort node in case it
> > was redundant included in 6.5 ?
> 
>     Sorry,
> 
>     I  missed  to  put  it  into after v6.4 release. And since it
>     wasn't there during v6.5 development, I would not put  it  in
>     now.
> 
>     Note that it wasn't in the v6.4 feature patches either, so it
>     isn't tested enough to get released.

But if it is not relesed it will _never_ be tested enough ...

As we are just going into beta, not relese, I would suggest to put 
it in now, and back out if it relly breaks anything. 

I have been using it with 6.4 almost since the relese an have 
seen no problems - in fact it solved a big problem and provided about 
1000X speedup for certain queries (a fraction of second instead of 
6 minutes) , not to mention avoiding backend crashes due to disk space 
exhaustion.

And it did not break anything in regression tests either, the only 
argument then was that there is nothing in regression tests that 
could possibly be broken by it ;)

I greatly prefer it over my previous method of doing the same on the 
client side (issuing an EXPLAIN, parsing it to see if it is SORT on 
INDEX SCAN, and omitting the ORDER BY if it is)

Also, not having it greatly diminishes the value of LIMIT.

I agree that it is a hack and only a partial solution and that in 
ideal world the optimiser would also know about sort nodes. 

But it is a very useful hack, and for some (like me) it is 
much bigger improvement than some 10% due to better memory 
allocation (which is of course great too).


----------------
Hannu


pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] PL/TCL bug (?)
Next
From: Hannu Krosing
Date:
Subject: Re: [HACKERS] 6.5 beta and ORDER BY patch