Re: [HACKERS] failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)

2015-03-09 Thread Robert Haas
On Wed, Mar 4, 2015 at 1:55 PM, Peter Geoghegan p...@heroku.com wrote: On Wed, Mar 4, 2015 at 8:26 AM, Robert Haas robertmh...@gmail.com wrote: I think we should commit my patch, and if a future patch needs sortKeys set in more places, it can make that change itself. There's no reason why

Re: [HACKERS] failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)

2015-03-04 Thread Peter Geoghegan
On Wed, Mar 4, 2015 at 8:26 AM, Robert Haas robertmh...@gmail.com wrote: I think we should commit my patch, and if a future patch needs sortKeys set in more places, it can make that change itself. There's no reason why it's needed with the code as it is today, and no reason to let bits of

Re: [HACKERS] failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)

2015-03-04 Thread Robert Haas
On Tue, Mar 3, 2015 at 7:14 PM, Peter Geoghegan p...@heroku.com wrote: My patch actually matches Andrew Gierth's datumsort patch, in that it also uses this convention, as I believe it should. For that reason, I'd prefer to make the comment added in November true, rather than changing the

Re: [HACKERS] failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)

2015-03-03 Thread Robert Haas
On Fri, Feb 20, 2015 at 4:01 PM, Peter Geoghegan p...@heroku.com wrote: On Fri, Feb 20, 2015 at 11:58 AM, Tomas Vondra tomas.von...@2ndquadrant.com wrote: This seems to happen because ordered_set_startup() calls tuplesort_begin_datum() when (use_tuples == true), which only sets 'onlyKey' and

Re: [HACKERS] failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)

2015-03-03 Thread Peter Geoghegan
On Tue, Mar 3, 2015 at 3:53 PM, Robert Haas robertmh...@gmail.com wrote: I find your statement that this is a pre-existing issue in tuplesort_begin_datum() to be pretty misleading, unless what you mean by it is pre-existing since November, when an earlier patch by Peter Geoghegan changed the

Re: [HACKERS] failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)

2015-02-20 Thread Peter Geoghegan
On Fri, Feb 20, 2015 at 11:58 AM, Tomas Vondra tomas.von...@2ndquadrant.com wrote: This seems to happen because ordered_set_startup() calls tuplesort_begin_datum() when (use_tuples == true), which only sets 'onlyKey' and leaves (sortKeys == NULL). So 'mergeruns' fails because it does not

[HACKERS] failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)

2015-02-20 Thread Tomas Vondra
Hi, while reviewing one of the 'abbreviated keys' patches, I noticed that the ordered set aggregates are broken when using tuplesort with multiple runs. ISTM this got broken by 5cefbf5a6c4466ac6b1cc2a4316b4eba9108c802: Don't use abbreviated keys for the final merge pass. When we write