Re: [HACKERS] Performance improvement for joins where outer side is unique

2015-03-13 Thread Kyotaro HORIGUCHI
Hello. The performance drag was not so large after all. For all that, I agree that the opition that this kind of separate multiple-nested loops on relations, joins or ECs and so on for searching something should be avoided. I personally feel that additional time to such an extent (around 1%) woul

Re: [HACKERS] Proposal : REINDEX xxx VERBOSE

2015-03-13 Thread Kyotaro HORIGUCHI
Hello, I have some trivial comments about the latest patch. At Thu, 12 Mar 2015 21:15:14 +0900, Sawada Masahiko wrote in sawada.mshk> On Thu, Mar 12, 2015 at 6:36 AM, Jim Nasby wrote: > >>> >Are the parenthesis necessary? No other WITH option requires them, other > >>> >than create table/matv

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Langote
On 12-03-2015 PM 11:46, Amit Kapila wrote: > [parallel_seqscan_v10.patch] There may be a bug in TupleQueueFunnelNext(). 1) I observed a hang with stack looking like: #0 0x0039696df098 in poll () from /lib64/libc.so.6 #1 0x006f1c6a in WaitLatchOrSocket (latch=0x7f29dc3c73b4, wakeEve

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Langote
On 13-03-2015 PM 05:32, Amit Langote wrote: > On 12-03-2015 PM 11:46, Amit Kapila wrote: >> [parallel_seqscan_v10.patch] > > There may be a bug in TupleQueueFunnelNext(). > > 1) I observed a hang with stack looking like: > > #0 0x0039696df098 in poll () from /lib64/libc.so.6 > #1 0x000

Re: [HACKERS] Reduce pinning in btree indexes

2015-03-13 Thread Kyotaro HORIGUCHI
Hello, At Thu, 12 Mar 2015 15:27:37 -0700, Peter Geoghegan wrote in > On Sat, Feb 14, 2015 at 4:19 PM, Kevin Grittner wrote: > > At some point we could consider building on this patch to recheck > > index conditions for heap access when a non-MVCC snapshot is used, > > check the visibility map

Re: [HACKERS] forward vs backward slashes in msvc build code

2015-03-13 Thread Michael Paquier
On Fri, Mar 13, 2015 at 6:20 AM, Alvaro Herrera wrote: > Peter Eisentraut wrote: >> This is contrib/chkpass not finding the crypt symbol, which is >> presumably in some library. But I can't see how it would normally find >> it, without my patch. > > It seems crypt is provided by libpgport. So chk

Re: [HACKERS] Reduce pinning in btree indexes

2015-03-13 Thread Simon Riggs
On 4 March 2015 at 03:16, Kevin Grittner wrote: > How do people feel about the idea of me pushing this for 9.5 (after > I clean up all the affected comments and README files)? I know > this first appeared in the last CF, but the footprint is fairly > small and the only user-visible behavior chan

[HACKERS] Regarding pg_stat_statements

2015-03-13 Thread Sreerama Manoj
Hi, As we know that "pg_stat_statements" will monitor the queries after normalizing the queries(Removes the values present in query). I want to know is there a way to store those normalized values because I want to check the type of data(values) ,range of data that is being hit to the databas

Re: [HACKERS] Join push-down support for foreign tables

2015-03-13 Thread Ashutosh Bapat
Hi Hanada-san, I noticed that the patch doesn't have any tests for testing FDW join in postgres_fdw. While you are updating the patch, can you please add few tests for the same. I will suggest adding tests for a combination of these dimensions 1. Types of joins 2. Joins between multiple foreign and

Re: [HACKERS] patch : Allow toast tables to be moved to a different tablespace

2015-03-13 Thread Julien Tachoires
Hi, On 10/03/2015 00:31, Andreas Karlsson wrote: > On 03/03/2015 04:14 PM, Julien Tachoires wrote: >> Sorry for the delay, I missed this thread. >> Here is a new version of this patch considering Andreas' comments. > > Please also add it to the next open commitfest so we do not lose the patch. H

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Kapila
On Fri, Mar 13, 2015 at 2:12 PM, Amit Langote wrote: > > On 13-03-2015 PM 05:32, Amit Langote wrote: > > On 12-03-2015 PM 11:46, Amit Kapila wrote: > >> [parallel_seqscan_v10.patch] > > > > There may be a bug in TupleQueueFunnelNext(). > > > > 1) I observed a hang with stack looking like: > > > >

Re: [HACKERS] Proposal : REINDEX xxx VERBOSE

2015-03-13 Thread Robert Haas
On Wed, Mar 11, 2015 at 5:36 PM, Jim Nasby wrote: > The thing is, ()s are actually an odd-duck. Very little supports it, and > while COPY allows it they're not required. EXPLAIN is a different story, > because that's not WITH; we're actually using () *instead of* WITH. Generally, I think the comm

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Kapila
On Thu, Mar 12, 2015 at 10:35 PM, Thom Brown wrote: > > > Another problem. I restarted the instance (just in case), and get this error: > > # \df+ *.* > ERROR: cannot retain locks acquired while in parallel mode > This problem occurs because above statement is trying to execute parallel_unsafe

Re: [HACKERS] WIP Patch for GROUPING SETS phase 1

2015-03-13 Thread Svenne Krap
Patch from message (87d24iukc5@news-spur.riddles.org.uk) fails (tried to apply on top of ebc0f5e01d2f ), as b55722692 has broken up the line (in src/backend/optimizer/util/pathnode.c): pathnode->path.rows = estimate_num_groups(root, uniq_exprs, rel->rows); After patching the added parameter

Re: [HACKERS] Reduce pinning in btree indexes

2015-03-13 Thread Simon Riggs
On 15 February 2015 at 00:19, Kevin Grittner wrote: > What they wanted was what happened in the other database product -- > if a snapshot got sufficiently old that cleaning up the MVCC data > was a problem *and* the snapshot was used again *and* it read a > page which had been modified far enough

Re: [HACKERS] Proposal : REINDEX xxx VERBOSE

2015-03-13 Thread Jim Nasby
On 3/13/15 6:48 AM, Robert Haas wrote: On Wed, Mar 11, 2015 at 5:36 PM, Jim Nasby wrote: The thing is, ()s are actually an odd-duck. Very little supports it, and while COPY allows it they're not required. EXPLAIN is a different story, because that's not WITH; we're actually using () *instead of

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Kapila
On Tue, Mar 10, 2015 at 12:26 PM, Amit Kapila wrote: > > On Tue, Mar 10, 2015 at 10:23 AM, Haribabu Kommi wrote: > > > > On Tue, Mar 10, 2015 at 3:09 PM, Amit Kapila wrote: > > > > > I have currently modelled it based on existing rescan for seqscan > > > (ExecReScanSeqScan()) which means it will

Re: [HACKERS] recovery_target_action doesn't work for anything but shutdown

2015-03-13 Thread Michael Paquier
On Thu, Mar 12, 2015 at 11:53 PM, Andres Freund wrote: > On 2015-03-12 15:52:02 +0100, Andres Freund wrote: >> I guess what you actually intended to test was StandbyModeRequested? > > Err, EnableHotStandby. Indeed. Without !EnableHotStandby, a node in recovery would simply be shut down even if a

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Kapila
On Thu, Mar 12, 2015 at 3:44 AM, Haribabu Kommi wrote: > > In create_parallelscan_paths() function the funnel path is added once > the partial seq scan > path is generated. I feel the funnel path can be added once on top of > the total possible > parallel path in the entire query path. > > Is this

Re: Custom/Foreign-Join-APIs (Re: [HACKERS] [v9.5] Custom Plan API)

2015-03-13 Thread Robert Haas
On Thu, Mar 12, 2015 at 8:09 PM, Thom Brown wrote: > On 12 March 2015 at 21:28, Tom Lane wrote: >> Robert Haas writes: >>> I took a look at this patch today and noticed that it incorporates not >>> only documentation for the new functionality it adds, but also for the >>> custom-scan functionali

Re: [HACKERS] Reduce pinning in btree indexes

2015-03-13 Thread Robert Haas
On Fri, Mar 13, 2015 at 8:52 AM, Simon Riggs wrote: > On 15 February 2015 at 00:19, Kevin Grittner wrote: >> What they wanted was what happened in the other database product -- >> if a snapshot got sufficiently old that cleaning up the MVCC data >> was a problem *and* the snapshot was used again

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Robert Haas
On Fri, Mar 13, 2015 at 9:01 AM, Amit Kapila wrote: > On Thu, Mar 12, 2015 at 3:44 AM, Haribabu Kommi > wrote: >> In create_parallelscan_paths() function the funnel path is added once >> the partial seq scan >> path is generated. I feel the funnel path can be added once on top of >> the total pos

Re: [HACKERS] Proposal : REINDEX xxx VERBOSE

2015-03-13 Thread Robert Haas
On Fri, Mar 13, 2015 at 8:57 AM, Jim Nasby wrote: > Yeah, that doesn't sound like a good tradeoff compared to making people type > some extra ()s. :( > > We should at least support ()s on the other commands though, so that we're > consistent. I think we've been moving slowly in that direction, bu

Re: [HACKERS] CATUPDATE confusion?

2015-03-13 Thread Robert Haas
On Thu, Mar 12, 2015 at 10:36 PM, Stephen Frost wrote: > As near as I can tell, pgAdmin3 does still use pg_user (though I don't > think it uses pg_group or pg_shadow except when connected to an ancient > server) in some cases. Where it is used, based on my quick review at > least, it looks like i

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Robert Haas
On Fri, Mar 13, 2015 at 8:59 AM, Amit Kapila wrote: > We can't directly call DestroyParallelContext() to terminate workers as > it can so happen that by that time some of the workers are still not > started. That shouldn't be a problem. TerminateBackgroundWorker() not only kills an existing work

Re: [HACKERS] CATUPDATE confusion?

2015-03-13 Thread Stephen Frost
Robert, * Robert Haas (robertmh...@gmail.com) wrote: > On Thu, Mar 12, 2015 at 10:36 PM, Stephen Frost wrote: > > Basically, in my view at least, these programs are likely to continue to > > use these backwards compatibility views until we either formally > > deprecate them or (more likely) until

Re: [HACKERS] CATUPDATE confusion?

2015-03-13 Thread Stephen Frost
* Stephen Frost (sfr...@snowman.net) wrote: > I should have been more specific. I don't believe they've moved to > using pg_roles completely (which was created specifically to address the > issue that regular users can't select from pg_authid). Err, forgot to finish that thought, sorry. Let's

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Robert Haas
On Fri, Mar 13, 2015 at 7:01 AM, Amit Kapila wrote: > I think this can happen if funnel->nextqueue is greater than > funnel->nqueues. > Please see if attached patch fixes the issue, else could you share the > scenario in more detail where you hit this issue. Speaking as the guy who wrote the firs

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Kapila
On Fri, Mar 13, 2015 at 7:15 PM, Robert Haas wrote: > > On Fri, Mar 13, 2015 at 7:01 AM, Amit Kapila wrote: > > I think this can happen if funnel->nextqueue is greater than > > funnel->nqueues. > > Please see if attached patch fixes the issue, else could you share the > > scenario in more detail

Re: [HACKERS] recovery_target_action doesn't work for anything but shutdown

2015-03-13 Thread Petr Jelinek
On 12/03/15 15:53, Andres Freund wrote: On 2015-03-12 15:52:02 +0100, Andres Freund wrote: I guess what you actually intended to test was StandbyModeRequested? Err, EnableHotStandby. Yeah pause does not work currently. This change was made by committer and I think the intended change was t

Re: [HACKERS] recovery_target_action doesn't work for anything but shutdown

2015-03-13 Thread Petr Jelinek
On 13/03/15 15:06, Petr Jelinek wrote: On 12/03/15 15:53, Andres Freund wrote: On 2015-03-12 15:52:02 +0100, Andres Freund wrote: I guess what you actually intended to test was StandbyModeRequested? Err, EnableHotStandby. Yeah pause does not work currently. This change was made by committe

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Langote
On Fri, Mar 13, 2015 at 11:03 PM, Amit Kapila wrote: > On Fri, Mar 13, 2015 at 7:15 PM, Robert Haas wrote: >> >> On Fri, Mar 13, 2015 at 7:01 AM, Amit Kapila >> wrote: >> > I think this can happen if funnel->nextqueue is greater than >> > funnel->nqueues. >> > Please see if attached patch fixes

Re: [HACKERS] Reduce pinning in btree indexes

2015-03-13 Thread Kevin Grittner
Kyotaro HORIGUCHI wrote: > At Thu, 12 Mar 2015 15:27:37 -0700, Peter Geoghegan wrote: >> On Sat, Feb 14, 2015 at 4:19 PM, Kevin Grittner wrote: >>> At some point we could consider building on this patch to >>> recheck index conditions for heap access when a non-MVCC >>> snapshot is used, check

[HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-03-13 Thread Pavel Stehule
Hi we found possible bug in pg_dump. It raise a error only when all specified tables doesn't exists. When it find any table, then ignore missing other. /usr/local/pgsql/bin/pg_dump -t Foo -t omega -s postgres > /dev/null; echo $? foo doesn't exists - it creates broken backup due missing "Foo" ta

Re: [HACKERS] Reduce pinning in btree indexes

2015-03-13 Thread Kevin Grittner
Robert Haas wrote: > On Fri, Mar 13, 2015 at 8:52 AM, Simon Riggs wrote: >> On 15 February 2015 at 00:19, Kevin Grittner wrote: >>> What they wanted was what happened in the other database >>> product -- if a snapshot got sufficiently old that cleaning up >>> the MVCC data was a problem *and* th

Re: [HACKERS] Regarding pg_stat_statements

2015-03-13 Thread Ronan Dunklau
Le vendredi 13 mars 2015 14:59:28 Sreerama Manoj a écrit : > Hi, > As we know that "pg_stat_statements" will monitor the queries after > normalizing the queries(Removes the values present in query). I want to > know is there a way to store those normalized values because I want to > check the

Re: [HACKERS] mogrify and indent features for jsonb

2015-03-13 Thread Petr Jelinek
On 01/03/15 16:49, Andrew Dunstan wrote: On 03/01/2015 05:03 AM, Petr Jelinek wrote: On 23/02/15 18:15, Dmitry Dolgov wrote: Hi, Petr, thanks for the review. >>> I think it would be better if the ident printing didn't put the start of array ([) and start of dictionary ({) on separate line Di

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-03-13 Thread Robert Haas
On Fri, Mar 13, 2015 at 11:26 AM, Pavel Stehule wrote: > we found possible bug in pg_dump. It raise a error only when all specified > tables doesn't exists. When it find any table, then ignore missing other. > > /usr/local/pgsql/bin/pg_dump -t Foo -t omega -s postgres > /dev/null; echo > $? > > fo

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-03-13 Thread Pavel Stehule
2015-03-13 17:39 GMT+01:00 Robert Haas : > On Fri, Mar 13, 2015 at 11:26 AM, Pavel Stehule > wrote: > > we found possible bug in pg_dump. It raise a error only when all > specified > > tables doesn't exists. When it find any table, then ignore missing other. > > > > /usr/local/pgsql/bin/pg_dump -

[HACKERS] Paper from IBM: Memory-Efficient Hash Joins

2015-03-13 Thread Arthur Silva
I've come across this paper today, I thought I'd share it here too. http://www.vldb.org/pvldb/vol8/p353-barber.pdf -- Arthur Silva

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-03-13 Thread David G. Johnston
On Fri, Mar 13, 2015 at 10:01 AM, Pavel Stehule wrote: > > > 2015-03-13 17:39 GMT+01:00 Robert Haas : > >> On Fri, Mar 13, 2015 at 11:26 AM, Pavel Stehule >> wrote: >> > we found possible bug in pg_dump. It raise a error only when all >> specified >> > tables doesn't exists. When it find any tab

Re: Custom/Foreign-Join-APIs (Re: [HACKERS] [v9.5] Custom Plan API)

2015-03-13 Thread Tom Lane
Robert Haas writes: > Another bit of this that I think we could commit without fretting > about it too much is the code adding set_join_pathlist_hook. This is > - I think - analogous to set_rel_pathlist_hook, and like that hook, > could be used for other purposes than custom plan generation - e.g

Re: [HACKERS] get_object_address support for additional object types

2015-03-13 Thread Stephen Frost
Alvaro, * Alvaro Herrera (alvhe...@2ndquadrant.com) wrote: > Stephen Frost wrote: > > I thought the rest of it looked alright. I agree it's a bit odd how the > > opfamily is handled but I agree with your assessment that there's not > > much better we can do with this object representation. > > A

Re: [HACKERS] New CF app deployment

2015-03-13 Thread Jeff Janes
On Sun, Feb 22, 2015 at 12:13 PM, Magnus Hagander wrote: > On Sun, Feb 15, 2015 at 9:46 PM, Peter Geoghegan wrote: > >> On Sun, Feb 15, 2015 at 4:59 PM, Peter Eisentraut >> wrote: >> > I think the old system where the patch submitter declared, this message >> > contains my patch, is the only on

Re: [HACKERS] logical column ordering

2015-03-13 Thread Jeff Janes
On Mon, Feb 23, 2015 at 3:09 PM, Tomas Vondra wrote: > Hi, > > attached is the result of my first attempt to make the logical column > ordering patch work. This touches a lot of code in the executor that is > mostly new to me, so if you see something that looks like an obvious > bug, it probably

Re: [HACKERS] Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs

2015-03-13 Thread Jeff Janes
On Mon, Jan 5, 2015 at 7:12 AM, Atri Sharma wrote: > > Hi All, > > Please forgive if this is a repost. > > Please find attached patch for supporting ORDER BY clause in CREATE > FUNCTION for SRFs. > Hi Atri, >From the discussion, I don't know if this patch is still being proposed. If so, it need

Re: [HACKERS] Using 128-bit integers for sum, avg and statistics aggregates

2015-03-13 Thread Peter Geoghegan
On Thu, Mar 12, 2015 at 6:23 PM, Andreas Karlsson wrote: > Fixed. Did you intend to attach a patch here? >> I think you should talk about the new thing first (just after the >> extant, first sentence "Integer data types use Numeric..."). Refer to >> where 128-bit integers are used and how, and o

Re: Custom/Foreign-Join-APIs (Re: [HACKERS] [v9.5] Custom Plan API)

2015-03-13 Thread Robert Haas
On Fri, Mar 13, 2015 at 2:31 PM, Tom Lane wrote: > Robert Haas writes: >> Another bit of this that I think we could commit without fretting >> about it too much is the code adding set_join_pathlist_hook. This is >> - I think - analogous to set_rel_pathlist_hook, and like that hook, >> could be u

Re: [HACKERS] pg_dump quietly ignore missing tables - is it bug?

2015-03-13 Thread Josh Berkus
On 03/13/2015 10:01 AM, Pavel Stehule wrote: > > > 2015-03-13 17:39 GMT+01:00 Robert Haas >: > > On Fri, Mar 13, 2015 at 11:26 AM, Pavel Stehule > mailto:pavel.steh...@gmail.com>> wrote: > > we found possible bug in pg_dump. It raise a error only when a

Re: [HACKERS] Strange debug message of walreciver?

2015-03-13 Thread Tatsuo Ishii
>> On Sun, Mar 8, 2015 at 8:13 PM, Tatsuo Ishii wrote: >>> >>> > On Sat, Mar 7, 2015 at 10:18 PM, Tatsuo Ishii >> wrote: >>> >> >>> >> When I set log_min_messages to debug5 and looked into walreciver log, >>> >> I saw this: >>> >> >>> >> 3600 2015-03-08 09:47:38 JST DEBUG: sendtime 2015-03-08 >>

Re: [HACKERS] Regarding pg_stat_statements

2015-03-13 Thread Josh Berkus
On 03/13/2015 02:29 AM, Sreerama Manoj wrote: > As we know that "pg_stat_statements" will monitor the queries > after normalizing the queries(Removes the values present in query). I > want to know is there a way to store those normalized values because I > want to check the type of data(value

[HACKERS] xloginsert.c hole_length warning on gcc 4.8.3

2015-03-13 Thread Tomas Vondra
Hi there, with gcc 4.8.3, I'm getting this warning in xloginsert.c: - xloginsert.c: In function ‘XLogInsert’: xloginsert.c:668:20: warning: ‘hole_length’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (hole_length != 0 && is_compressed)

Re: Custom/Foreign-Join-APIs (Re: [HACKERS] [v9.5] Custom Plan API)

2015-03-13 Thread Tom Lane
Robert Haas writes: > On Fri, Mar 13, 2015 at 2:31 PM, Tom Lane wrote: >> I don't object to the concept, but I think that is a pretty bad place >> to put the hook call: add_paths_to_joinrel is typically called multiple >> (perhaps *many*) times per joinrel and thus this placement would force >> a

Re: [HACKERS] Re: Abbreviated keys for Datum tuplesort

2015-03-13 Thread Peter Geoghegan
On Sun, Jan 25, 2015 at 3:15 AM, Andrew Gierth wrote: > Robert> I think this is a good idea. Do you have a test case that > Robert> shows the benefit? > > The best test case for datum sort performance is to use percentile_disc, > since that has almost no overhead beyond performing the actual so

[HACKERS] Ye olde write_history() return code problem

2015-03-13 Thread Tom Lane
David Johnston's recent gripe reminded me of the problem we've been working around for many years, that readline and libedit don't agree on the return code convention for write_history(). We've attempted to work around that by supposing that if errno becomes set to nonzero during write_history() t

Re: [HACKERS] Performance improvement for joins where outer side is unique

2015-03-13 Thread David Rowley
On 13 March 2015 at 20:34, Kyotaro HORIGUCHI < horiguchi.kyot...@lab.ntt.co.jp> wrote: > Hello. The performance drag was not so large after all. > > Great, thanks for retesting this. > For all that, I agree that the opition that this kind of separate > multiple-nested loops on relations, joins

Re: [HACKERS] Re: Abbreviated keys for Datum tuplesort

2015-03-13 Thread Andrew Gierth
> "Peter" == Peter Geoghegan writes: Peter> I attach a slightly tweaked version of Andrew's original. You changed this: static int comparetup_datum(const SortTuple *a, const SortTuple *b, Tuplesortstate *state) { -int compare; +int32 compare; compare = Apply

Re: [HACKERS] Using 128-bit integers for sum, avg and statistics aggregates

2015-03-13 Thread Andreas Karlsson
On 03/13/2015 10:22 PM, Peter Geoghegan wrote: On Thu, Mar 12, 2015 at 6:23 PM, Andreas Karlsson wrote: /* * Integer data types use Numeric accumulators to share code and avoid risk * of overflow. To speed up aggregation 128-bit integer accumulators are * used instead where sum(X) or sum

Re: [HACKERS] Parallel Seq Scan

2015-03-13 Thread Amit Kapila
On Thu, Mar 12, 2015 at 9:50 PM, Thom Brown wrote: > > On 12 March 2015 at 15:29, Amit Kapila wrote: > > Please note that parallel_setup_cost and parallel_startup_cost are > > still set to zero by default, so you need to set it to higher values > > if you don't want the parallel plans once parall