Re: [HACKERS] Dynamic result sets from procedures

2017-11-04 Thread Daniel Verite
Peter Eisentraut wrote: > > CREATE PROCEDURE test() > > LANGUAGE plpgsql > > AS $$ > > RETURN QUERY EXECUTE 'SELECT 1 AS col1, 2 AS col2'; > > END; > > $$; > > > > Or is that not possible or not desirable? > > RETURN means the execution ends there, so how would you return

Re: [HACKERS] pgbench - allow to store select results into variables

2017-11-04 Thread Fabien COELHO
Hello Pavel, Here is a v13, which is just a rebase after the documentation xml-ization. Here is a v14, after yet another rebase, and some comments added to answer your new comments. I am looking to this patch. Not sure if "cset" is best name - maybe "eset" .. like embeded set? I used

Re: [HACKERS] Add some const decorations to prototypes

2017-11-04 Thread Peter Eisentraut
On 11/3/17 13:54, Tom Lane wrote: >> Would you prefer leaving the input argument as char *, or change the >> endptr argument to const as well? > > Just leave it as char*. If you change the endptr argument you're going to > force every call site to change their return variable, and some of them >

Re: [HACKERS] Add some const decorations to prototypes

2017-11-04 Thread Fabien COELHO
Just leave it as char*. If you change the endptr argument you're going to force every call site to change their return variable, and some of them would end up having to cast away the const on their end. OK, here is an updated patch with the controversial bits removed. I'm in general favor

[HACKERS] Display number of heap accesses for index scans

2017-11-04 Thread Andres Freund
Hi, right now it's hard to figure out whether a plain indexscan returns matches that then get eliminated due to visibility checks in the heap. For both index only scans (via "Heap Fetches") and bitmapscans (via row mismatches between bitmap heap and index scans) one can gather that to some degree

Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

2017-11-04 Thread Andres Freund
On 2017-11-03 12:36:59 -0700, Peter Geoghegan wrote: > Andres Freund wrote: > > Here's that patch. I've stared at this some, and Robert did too. Robert > > mentioned that the commit message might need some polish and I'm not > > 100% sure about the error message texts yet. >

Re: [HACKERS] [POC] Faster processing at Gather node

2017-11-04 Thread Andres Freund
Hi, On 2017-11-04 16:38:31 +0530, Robert Haas wrote: > On hydra (PPC), these changes didn't help much. Timings: > > master: 29605.582, 29753.417, 30160.485 > patch: 28218.396, 27986.951, 26465.584 > > That's about a 5-6% improvement. On my MacBook, though, the > improvement was quite a bit

Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple

2017-11-04 Thread Andres Freund
On 2017-11-04 06:15:00 -0700, Andres Freund wrote: > The current testcase, and I think the descriptions in the relevant > threads, all actually fail to point out the precise way the bug is > triggered. As e.g. evidenced that the freeze-the-dead case appears to > not cause any failures in

Re: [HACKERS] [COMMITTERS] pgsql: Account for catalog snapshot in PGXACT->xmin updates.

2017-11-04 Thread Tom Lane
Noah Misch writes: > I plan to use the attached patch after the minor release tags land. If > there's significant support, I could instead push before the wrap. This looks fine to me --- I think you should push now. (which reminds me, I'd better get on with making release

Re: [HACKERS] [PATCH] A hook for session start

2017-11-04 Thread Fabrízio de Royes Mello
On Sat, Nov 4, 2017 at 1:23 AM, Michael Paquier wrote: > > On Fri, Nov 3, 2017 at 1:55 PM, Fabrízio de Royes Mello > wrote: > >> Passing the database name and user name does not look much useful to > >> me. You can have access to this data

Re: [HACKERS] taking stdbool.h into use

2017-11-04 Thread Peter Eisentraut
On 10/29/17 08:50, Michael Paquier wrote: > On Thu, Oct 26, 2017 at 9:25 AM, Peter Eisentraut > wrote: >> Here is an updated patch set. This is just a rebase of the previous >> set, no substantial changes. Based on the discussion so far, I'm >> proposing that

Re: [HACKERS] why not parallel seq scan for slow functions

2017-11-04 Thread Amit Kapila
On Thu, Sep 21, 2017 at 2:35 AM, Jeff Janes wrote: > On Tue, Sep 19, 2017 at 9:15 PM, Amit Kapila > wrote: >> >> On Wed, Sep 20, 2017 at 3:05 AM, Jeff Janes wrote: >> > On Tue, Sep 19, 2017 at 1:17 PM, Thomas Munro >> >

Re: [HACKERS] Parallel Plans and Cost of non-filter functions

2017-11-04 Thread Amit Kapila
On Sat, Nov 4, 2017 at 4:43 AM, Tom Lane wrote: > Paul Ramsey writes: >>> Whether I get a parallel aggregate seems entirely determined by the number >>> of rows, not the cost of preparing those rows. > >> This is true, as far as I can tell and

Re: [HACKERS] [POC] Faster processing at Gather node

2017-11-04 Thread Andres Freund
On 2017-11-05 01:05:59 +0100, Robert Haas wrote: > skip-gather-project-v1.patch does what it says on the tin. I still > don't have a test case for this, and I didn't find that it helped very > much, but it would probably help more in a test case with more > columns, and you said this looked like

Re: [HACKERS] possible encoding issues with libxml2 functions

2017-11-04 Thread Noah Misch
On Tue, Oct 17, 2017 at 06:06:40AM +0200, Pavel Stehule wrote: > Please, if you can, try it write. I am little bit lost :) I'm attaching the patch I desired. Please review. This will probably miss this week's minor releases. If there's significant support, I could instead push before the wrap.

[HACKERS] Re: [COMMITTERS] pgsql: Account for catalog snapshot in PGXACT->xmin updates.

2017-11-04 Thread Noah Misch
On Mon, Aug 21, 2017 at 07:41:52AM +0100, Simon Riggs wrote: > On 19 August 2017 at 20:54, Noah Misch wrote: > > On Tue, Dec 06, 2016 at 01:59:18PM -0500, Robert Haas wrote: > >> On Tue, Dec 6, 2016 at 1:36 PM, Tom Lane wrote: > >> > Robert Haas

Re: [HACKERS] [POC] Faster processing at Gather node

2017-11-04 Thread Robert Haas
On Wed, Oct 18, 2017 at 3:09 AM, Andres Freund wrote: > 2) The spinlocks both on the the sending and receiving side a quite hot: > >rafia query leader: > + 36.16% postgres postgres[.] shm_mq_receive > + 19.49% postgres postgres[.] s_lock > +

Re: [HACKERS] pow support for pgbench

2017-11-04 Thread Fabien COELHO
Hello Raúl, Sorry about the patch. Attaching it now so it can be considered as submitted. There is a typo in the XML doc: 1024.0/ Please check that the documentation compiles. I'm at odds with having the integer version rely on a double pow(), even if it works. I think that there

Re: [HACKERS] Parallel Plans and Cost of non-filter functions

2017-11-04 Thread Tels
Moin, On Fri, November 3, 2017 7:13 pm, Tom Lane wrote: > Paul Ramsey writes: >>> Whether I get a parallel aggregate seems entirely determined by the >>> number >>> of rows, not the cost of preparing those rows. > >> This is true, as far as I can tell and unfortunate.

Re: [HACKERS] Small improvement to compactify_tuples

2017-11-04 Thread Peter Geoghegan
Юрий Соколов wrote: tps is also reflects changes: ~17ktps with qsort ~19ktps with bucket sort Also vacuum of benchmark's table is also improved: ~3s with qsort, ~2.4s with bucket sort One thing that you have to be careful with when it comes to our qsort with partially

Re: [HACKERS] [POC] Faster processing at Gather node

2017-11-04 Thread Robert Haas
On Sat, Nov 4, 2017 at 5:55 PM, Andres Freund wrote: >> master: 21436.745, 20978.355, 19918.617 >> patch: 15896.573, 15880.652, 15967.176 >> >> Median-to-median, that's about a 24% improvement. > > Neat! With the attached stack of 4 patches, I get: 10811.768 ms, 10743.424 ms,

Re: [HACKERS] Support to COMMENT ON DATABASE CURRENT_DATABASE

2017-11-04 Thread Bossart, Nathan
On 10/5/17, 11:53 PM, "Jing Wang" wrote: > The patch has been updated according to Nathan's comments.  > Thanks Nathan's review. Thanks for the new versions of the patches. I apologize for the long delay for this new review. It looks like the no-pgdump patch needs a

[HACKERS] Release notes for next week's minor releases are up for review

2017-11-04 Thread Tom Lane
... at https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=42de8a0255c2509bf179205e94b9d65f9d6f3cf9 regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] Small improvement to compactify_tuples

2017-11-04 Thread Юрий Соколов
2017-11-03 5:46 GMT+03:00 Tom Lane : > > Sokolov Yura writes: > > [ 0001-Improve-compactify_tuples.patch, v5 or thereabouts ] > > I went to check the shellsort algorithm against Wikipedia's entry, > and found that this appears to be an incorrect