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

2017-07-11 Thread Amit Kapila
On Wed, Jul 12, 2017 at 1:50 AM, Jeff Janes wrote: > On Mon, Jul 10, 2017 at 9:51 PM, Dilip Kumar wrote: >> >> So because of this high projection cost the seqpath and parallel path >> both have fuzzily same cost but seqpath is winning because it's >> parallel safe. > > > I think you are correct.

Re: [HACKERS] pgsql 10: hash indexes testing

2017-07-11 Thread Amit Kapila
On Tue, Jul 11, 2017 at 11:08 PM, Alvaro Herrera wrote: > Amit Kapila wrote: > >> Yes, I also think the same idea can be used, in fact, I have mentioned >> it [1] as soon as you have committed that patch. Do we want to do >> anything at this stage for PG-10? I don't think we should attempt >> so

Re: [HACKERS] Minor style cleanup in tab-complete.c

2017-07-11 Thread Michael Paquier
On Wed, Jul 12, 2017 at 11:19 AM, Thomas Munro wrote: > From the triviality department: I noticed some branches in > tab-complete.c's gargantuan if statement, mostly brand new, that break > from the established brace style. Should we fix that like this? For consistency I think it does. -- Micha

Re: [HACKERS] New partitioning - some feedback

2017-07-11 Thread Amit Langote
On 2017/07/12 12:47, Ashutosh Bapat wrote: > On Wed, Jul 12, 2017 at 8:23 AM, Amit Langote > wrote: >> On 2017/07/11 18:57, Ashutosh Bapat wrote: >>> On Tue, Jul 11, 2017 at 4:16 AM, David Fetter wrote: So whatever we land on needs to mention partition_of and has_partitions. Is that la

Re: [HACKERS] New partitioning - some feedback

2017-07-11 Thread Ashutosh Bapat
On Wed, Jul 12, 2017 at 8:23 AM, Amit Langote wrote: > On 2017/07/11 18:57, Ashutosh Bapat wrote: >> On Tue, Jul 11, 2017 at 4:16 AM, David Fetter wrote: >>> So whatever we land on needs to mention partition_of and >>> has_partitions. Is that latter just its immediate partitions? >>> Recursion a

Re: [HACKERS] New partitioning - some feedback

2017-07-11 Thread Amit Langote
On 2017/07/11 13:34, Alvaro Herrera wrote: > Robert Haas wrote: >> On Mon, Jul 10, 2017 at 2:15 AM, Amit Langote >> wrote: > >>> Actually, if \d had shown RELKIND_PARTITIONED_TABLE tables as of Type >>> "partitioned table", we wouldn't need a separate flag for marking a table >>> as having partit

Re: [HACKERS] New partitioning - some feedback

2017-07-11 Thread Amit Langote
On 2017/07/11 18:57, Ashutosh Bapat wrote: > On Tue, Jul 11, 2017 at 4:16 AM, David Fetter wrote: >> So whatever we land on needs to mention partition_of and >> has_partitions. Is that latter just its immediate partitions? >> Recursion all the way down? Somewhere in between? >> > > We have patc

[HACKERS] Minor style cleanup in tab-complete.c

2017-07-11 Thread Thomas Munro
Hi, >From the triviality department: I noticed some branches in tab-complete.c's gargantuan if statement, mostly brand new, that break from the established brace style. Should we fix that like this? -- Thomas Munro http://www.enterprisedb.com remove-extraneous-braces-from-tab-complete.patch D

Re: [HACKERS] Subscription code improvements

2017-07-11 Thread Masahiko Sawada
On Sat, Jul 8, 2017 at 5:19 AM, Petr Jelinek wrote: > Hi, > > I have done some review of subscription handling (well self-review) and > here is the result of that (It's slightly improved version from another > thread [1]). Thank you for working on this and patches! > I split it into several patc

Re: [HACKERS] Multi column range partition table

2017-07-11 Thread Amit Langote
On 2017/07/12 4:24, Dean Rasheed wrote: > On 11 July 2017 at 13:29, Ashutosh Bapat > wrote: >> Most of the patch seems to be replacing "content" with "kind", >> RangeDatumContent with PartitionRangeDatumKind and RANGE_DATUM_FINITE >> with PARTITION_RANGE_DATUM_VALUE. But those changes in name do

Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()

2017-07-11 Thread Amit Langote
On 2017/07/11 19:49, Ashutosh Bapat wrote: > On Tue, Jul 4, 2017 at 9:51 AM, Amit Langote > wrote: > >> >> Attached updated patches. > > There's an extra "we" in > +* Note that attachRel's OID is in this list. If it's partitioned, we > +* we don't need to schedule it to be scann

[HACKERS] Finding the min bounding box of an Index leaf page

2017-07-11 Thread Amira Shawky
Greetings, I have SPGist and Gist index are built on 2d points. I'm wondering does spgist/gist track the bounding box of each leaf page (data block)? and if yes, how can I access it Best Regards --- Amira Shawky Mohamed TA at Computer Dept. Faculty of Engineering Cairo University

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2017-07-11 Thread Alvaro Herrera
Mark Rofail wrote: >- now the RI checks utilise the @>(anyarray, anyelement) > - however there's a small problem: > operator does not exist: integer[] @> smallint > I assume that external casting would be required here. But how can I > downcast smallint to integer or in

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2017-07-11 Thread Mark Rofail
here are the modifications to ri_triggers.c On Wed, Jul 12, 2017 at 12:26 AM, Mark Rofail wrote: > > *What I did * > >- now the RI checks utilise the @>(anyarray, anyelement) > > Best Regards, > Mark Rofail > diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2017-07-11 Thread Mark Rofail
On Sun, Jul 9, 2017 at 7:42 PM, Alexander Korotkov wrote: > We may document that GIN index is required to accelerate RI queries for > array FKs. And users are encouraged to manually define them. > It's also possible to define new option when index on referencing > column(s) would be created auto

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

2017-07-11 Thread Jeff Janes
On Mon, Jul 10, 2017 at 9:51 PM, Dilip Kumar wrote: > > > In below function, we always multiply the target->cost.per_tuple with > path->rows, but in case of gather it should multiply this with > subpath->rows > > apply_projection_to_path() > > > path->startup_cost += target->cost.startup - o

Re: [HACKERS] Multi column range partition table

2017-07-11 Thread Dean Rasheed
On 11 July 2017 at 13:29, Ashutosh Bapat wrote: > + > + Also note that some element types, such as timestamp, > + have a notion of "infinity", which is just another value that can > + be stored. This is different from MINVALUE and > + MAXVALUE, which are not real values th

[HACKERS] Domains and arrays and composites, oh my

2017-07-11 Thread Tom Lane
I started to look into allowing domains over composite types, which is another never-implemented case that there's no very good reason not to allow. Well, other than the argument that the SQL standard only allows domains over "predefined" (built-in) types ... but we blew past that restriction ages

Re: [HACKERS] Arrays of domains

2017-07-11 Thread Andrew Dunstan
On 07/11/2017 12:44 PM, Tom Lane wrote: > > Can anyone think of a reason not to pursue that? > > I'm all for it. cheers andrew -- Andrew Dunstanhttps://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pg

Re: [HACKERS] Arrays of domains

2017-07-11 Thread David Fetter
On Tue, Jul 11, 2017 at 12:44:33PM -0400, Tom Lane wrote: > Over in > https://www.postgresql.org/message-id/877ezgyn60@metapensiero.it > there's a gripe about array_agg() not working for a domain type. > It fails because we don't create an array type over a domain type, > so the parser can't id

Re: [HACKERS] pgsql 10: hash indexes testing

2017-07-11 Thread Alvaro Herrera
Amit Kapila wrote: > Yes, I also think the same idea can be used, in fact, I have mentioned > it [1] as soon as you have committed that patch. Do we want to do > anything at this stage for PG-10? I don't think we should attempt > something this late unless people feel this is a show-stopper issu

Fwd: [HACKERS] Vacuum: allow usage of more than 1GB of work mem

2017-07-11 Thread Claudio Freire
Resending without the .tar.bz2 that get blocked Sorry for the delay, I had extended vacations that kept me away from my test rigs, and afterward testing too, liteally, a few weeks. I built a more thoroguh test script that produced some interesting results. Will attach the results. For now, to t

[HACKERS] Arrays of domains

2017-07-11 Thread Tom Lane
Over in https://www.postgresql.org/message-id/877ezgyn60@metapensiero.it there's a gripe about array_agg() not working for a domain type. It fails because we don't create an array type over a domain type, so the parser can't identify a suitable output type for the polymorphic aggregate. We cou

[HACKERS] GSoC 2017: weekly progress reports (week 6)

2017-07-11 Thread Shubham Barai
Project: Explicitly support predicate locks in index AMs besides b-tree I have done following tasks during this week. 1) worked on how to detect rw conflicts when fast update is enabled 2) created tests for different gin operators 3) went through some patches on commitfest to review 4) solved

Re: [HACKERS] Multi column range partition table

2017-07-11 Thread Ashutosh Bapat
On Sun, Jul 9, 2017 at 1:12 PM, Dean Rasheed wrote: > On 6 July 2017 at 22:43, Joe Conway wrote: >> I agree we should get this right the first time and I also agree with >> Dean's proposal, so I guess I'm a +2 >> > > On 7 July 2017 at 03:21, Amit Langote wrote: >> +1 to releasing this syntax in

Re: [HACKERS] pgsql 10: hash indexes testing

2017-07-11 Thread Amit Kapila
On Tue, Jul 11, 2017 at 8:10 AM, Alvaro Herrera wrote: > Amit Kapila wrote: >> On Tue, Jul 11, 2017 at 6:51 AM, AP wrote: >> > On Fri, Jul 07, 2017 at 05:58:25PM +0530, Amit Kapila wrote: > >> >> I can understand your concerns. To address first concern we need to >> >> work on one or more of fol

Re: [HACKERS] pgsql 10: hash indexes testing

2017-07-11 Thread AP
On Fri, Jul 07, 2017 at 05:58:25PM +0530, Amit Kapila wrote: > On Fri, Jul 7, 2017 at 8:22 AM, AP wrote: > > On Thu, Jul 06, 2017 at 05:19:59PM +0530, Amit Kapila wrote: > >> I think if you are under development, it is always advisable to create > >> indexes after initial bulk load. That way it w

Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()

2017-07-11 Thread Ashutosh Bapat
On Tue, Jul 4, 2017 at 9:51 AM, Amit Langote wrote: > > Attached updated patches. There's an extra "we" in +* Note that attachRel's OID is in this list. If it's partitioned, we +* we don't need to schedule it to be scanned (would be a noop anyway And some portions of the commen

Re: [HACKERS] New partitioning - some feedback

2017-07-11 Thread Ashutosh Bapat
On Tue, Jul 11, 2017 at 4:16 AM, David Fetter wrote: > On Mon, Jul 10, 2017 at 05:33:34PM -0500, Robert Haas wrote: >> On Mon, Jul 10, 2017 at 2:15 AM, Amit Langote >> wrote: >> > I posted a patch upthread which makes \d hide partitions >> > (relispartition = true relations) and include them if t

Re: [HACKERS] asynchronous execution

2017-07-11 Thread Antonin Houska
Kyotaro HORIGUCHI wrote: > > Just one idea that I had while reading the code. > > > > In ExecAsyncEventLoop you iterate estate->es_pending_async, then move the > > complete requests to the end and finaly adjust estate->es_num_pending_async > > so > > that the array no longer contains the comple

[HACKERS] Typo in backend/storage/ipc/standby.c

2017-07-11 Thread Kyotaro HORIGUCHI
Hello. I noticed that a comment above StandbyAcquireAccessExclusiveLock in backend/storage/ipc/standby.c using wrong names of a variable and a type. The attached patch fixes it. The same mistake is found in older versions back to 9.0. fix_typo_of_standby_c_10_master.patch is for 10 and master an