Re: [HACKERS] path toward faster partition pruning

2017-11-13 Thread Amit Langote
Horiguchi-san, Thanks for taking a look. Replying to all your emails here. On 2017/11/10 12:30, Kyotaro HORIGUCHI wrote: > In 0002, bms_add_range has a bit naive-looking loop > > + while (wordnum <= uwordnum) > + { > + bitmapword mask = (bitmapword) ~0; > + > +

Re: [HACKERS] path toward faster partition pruning

2017-11-09 Thread Amit Langote
Hi Amul. On 2017/11/09 20:05, amul sul wrote: > On Mon, Nov 6, 2017 at 3:31 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> On 2017/11/06 14:32, David Rowley wrote: >>> On 6 November 2017 at 17:30, Amit Langote wrote: >>>> On 2017/11/03 13:32,

Re: [HACKERS] [PATCH] fix wrong create table statement in documentation

2017-11-08 Thread Amit Langote
On 2017/11/09 7:21, Tom Lane wrote: > jotpe writes: >> In the current documentation [1] this create table statement is listed: >> CREATE TABLE measurement_y2008m01 PARTITION OF measurement >> FOR VALUES FROM ('2008-01-01') TO ('2008-02-01') >> TABLESPACE fasttablespace

Re: [HACKERS] path toward faster partition pruning

2017-11-08 Thread Amit Langote
Hi Rajkumar, Thanks for testing. On 2017/11/08 15:52, Rajkumar Raghuwanshi wrote: > On Mon, Nov 6, 2017 at 3:31 PM, Amit Langote <langote_amit...@lab.ntt.co.jp> > wrote: > >> Attached updated set of patches, including the fix to make the new pruning >> code

Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2017-11-07 Thread Amit Langote
Hi David. Thanks for the review. (..also looking at the comments you sent earlier today.) On 2017/11/07 11:14, David Rowley wrote: > On 7 November 2017 at 01:52, David Rowley > wrote: >> Thanks. I'll look over it all again starting my Tuesday morning. (UTC+13) >

Re: [HACKERS] UPDATE of partition key

2017-11-06 Thread Amit Langote
On 2017/11/07 14:40, Amit Khandekar wrote: > On 7 November 2017 at 00:33, Robert Haas wrote: > >> Also, +1 for Amit Langote's idea of trying to merge >> mt_perleaf_childparent_maps with mt_persubplan_childparent_maps. > > Currently I am trying to see if it simplifies

Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2017-11-06 Thread Amit Langote
On 2017/11/06 21:52, David Rowley wrote: > On 6 November 2017 at 23:01, Amit Langote <langote_amit...@lab.ntt.co.jp> > wrote: >> OK, I have gotten rid of the min/max partition index interface and instead >> adopted the bms_add_range() approach by including your

Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2017-11-06 Thread Amit Langote
On 2017/11/06 13:15, David Rowley wrote: > On 31 October 2017 at 21:43, Amit Langote <langote_amit...@lab.ntt.co.jp> > wrote: >> Attached updated version of the patches > > match_clauses_to_partkey() needs to allow for the way quals on Bool > columns are represented. &

Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning

2017-11-05 Thread Amit Langote
On 2017/11/06 12:53, David Rowley wrote: > On 3 November 2017 at 17:32, David Rowley > wrote: >> 2. This code is way more complex than it needs to be. >> >> if (num_parts > 0) >> { >> int j; >> >> all_indexes = (int *) palloc(num_parts * sizeof(int)); >> j = 0; >>

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-11-05 Thread Amit Langote
On 2017/11/03 21:39, Alvaro Herrera wrote: > Ashutosh Bapat wrote: >> On Fri, Nov 3, 2017 at 1:42 PM, Alvaro Herrera >> wrote: > >>> I think adding "is partitioned" at end of line isn't good; looks like a >>> phrase but isn't translatable. Maybe add keyword PARTITIONED

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-11-05 Thread Amit Langote
On 2017/11/03 6:24, Tom Lane wrote: > Amit Langote <langote_amit...@lab.ntt.co.jp> writes: >> On 2017/09/26 16:30, Michael Paquier wrote: >>> Cool, let's switch it back to a ready for committer status then. > >> Sure, thanks. > > Pushed with some

Re: [HACKERS] UPDATE of partition key

2017-11-02 Thread Amit Langote
Hi Amit. Thanks a lot for updated patches and sorry that I couldn't get to looking at your emails sooner. Note that I'm replying here to both of your emails, but looking at only the latest v22 patch. On 2017/10/24 0:15, Amit Khandekar wrote: > On 16 October 2017 at 08:28, Amit Lang

Re: [HACKERS] Adding column_constraint description in ALTER TABLE synopsis

2017-10-31 Thread Amit Langote
On 2017/10/31 21:31, Stephen Frost wrote: > * Lætitia Avrot (laetitia.av...@gmail.com) wrote: >> As Amit Langot pointed out, the column_constraint definition is missing >> whereas it is used in ALTER TABLE synopsis. It can be easily found in the >> CREATE TABLE synopsis, but it's not very user

Re: [HACKERS] path toward faster partition pruning

2017-10-31 Thread Amit Langote
Thanks for the test case. On 2017/10/30 17:09, Rajkumar Raghuwanshi wrote: > I am getting wrong output when default is sub-partitioned further, below is > a test case. > > CREATE TABLE lpd(a int, b varchar, c float) PARTITION BY LIST (a); > CREATE TABLE lpd_p1 PARTITION OF lpd FOR VALUES IN

Re: [HACKERS] path toward faster partition pruning

2017-10-27 Thread Amit Langote
On 2017/10/27 13:57, Robert Haas wrote: > On Fri, Oct 27, 2017 at 3:17 AM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >>> I don't think we really want to get into theorem-proving here, because >>> it's slow. >> >> Just to be clear, I'm sayi

Re: [HACKERS] path toward faster partition pruning

2017-10-26 Thread Amit Langote
On 2017/10/26 20:34, Robert Haas wrote: > On Thu, Oct 26, 2017 at 1:17 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> It can perhaps taught to not make that conclusion by taking into account >> the default partition's partition constraint, which includes cons

Re: [HACKERS] [sqlsmith] Failed assertion in adjust_appendrel_attrs_mutator

2017-10-23 Thread Amit Langote
On 2017/10/24 0:22, Tom Lane wrote: > Amit Langote <langote_amit...@lab.ntt.co.jp> writes: >> On 2017/10/23 2:07, Tom Lane wrote: >>> Hmm. adjust_appendrel_attrs() thinks it's only used after conversion >>> of sublinks to subplans, but this is a counterexample.

Re: [HACKERS] Proposal: Local indexes for partitioned table

2017-10-23 Thread Amit Langote
On 2017/10/24 1:15, Alvaro Herrera wrote: > Robert Haas wrote: >> On Mon, Oct 23, 2017 at 11:12 AM, Alvaro Herrera >> wrote: >>> I started with Maksim's submitted code, and developed according to the >>> ideas discussed in this thread. Attached is a very WIP patch series

Re: [HACKERS] [sqlsmith] Failed assertion in adjust_appendrel_attrs_mutator

2017-10-23 Thread Amit Langote
On 2017/10/23 2:07, Tom Lane wrote: > Andreas Seltenreich writes: >> testing master as of 7c981590c2, sqlsmith just triggered the following >> assertion: >> TRAP: FailedAssertion("!(!const Node*)(node))->type) == T_SubLink))", >> File: "prepunion.c", Line: 2231) > > Hmm.

Re: [HACKERS] alter table doc fix

2017-10-22 Thread Amit Langote
On 2017/10/18 20:37, Alvaro Herrera wrote: > Amit Langote wrote: >> Hi. >> >> Noticed that a alter table sub-command's name in Description (where it's >> OWNER) differs from that in synopsis (where it's OWNER TO). Attached >> patch to make them match, if the di

Re: [HACKERS] Block level parallel vacuum WIP

2017-10-22 Thread Amit Langote
On 2017/10/22 5:25, Thomas Munro wrote: > On Sun, Oct 22, 2017 at 5:09 AM, Robert Haas wrote: >> On Tue, Sep 19, 2017 at 3:31 AM, Masahiko Sawada >> wrote: Down at the bottom of the build log in the regression diffs file you can see:

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-17 Thread Amit Langote
On 2017/10/18 1:52, Alvaro Herrera wrote: > Alvaro Herrera wrote: >> Robert Haas wrote: >>> Implement table partitioning. >> >> Is it intentional that you can use ALTER TABLE OWNER TO on the parent >> table, and that this does not recurse to modify the partitions' owners? >> This doesn't seem to

[HACKERS] alter table doc fix

2017-10-17 Thread Amit Langote
Hi. Noticed that a alter table sub-command's name in Description (where it's OWNER) differs from that in synopsis (where it's OWNER TO). Attached patch to make them match, if the difference is unintentional. Thanks, Amit diff --git a/doc/src/sgml/ref/alter_table.sgml

Re: [HACKERS] relkind check in DefineIndex

2017-10-15 Thread Amit Langote
On 2017/10/14 4:32, Robert Haas wrote: > On Fri, Oct 13, 2017 at 12:38 PM, Alvaro Herrera > wrote: >> The relkind check in DefineIndex has grown into an ugly rats nest of >> 'if' statements. I propose to change it into a switch, as per the >> attached. > > wfm +1

Re: [HACKERS] UPDATE of partition key

2017-10-15 Thread Amit Langote
Hi Amit. On 2017/10/04 22:51, Amit Khandekar wrote: > Main patch : > update-partition-key_v20.patch Guess you're already working on it but the patch needs a rebase. A couple of hunks in the patch to execMain.c and nodeModifyTable.c fail. Meanwhile a few comments: +void

Re: [HACKERS] v10 bottom-listed

2017-10-15 Thread Amit Langote
On 2017/10/13 22:58, Magnus Hagander wrote: > On Fri, Oct 6, 2017 at 3:59 AM, Amit Langote <langote_amit...@lab.ntt.co.jp> > wrote: > >> On 2017/10/05 22:28, Erik Rijkers wrote: >>> In the 'ftp' listing, v10 appears at the bottom: >>> https://www.post

Re: [HACKERS] UPDATE of partition key

2017-10-12 Thread Amit Langote
On 2017/10/13 6:18, Robert Haas wrote: > Is anybody still reviewing the main patch here? (It would be good if > the answer is "yes".) I am going to try to look at the latest version over the weekend and early next week. Thanks, Amit -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Optimise default partition scanning while adding new partition

2017-10-12 Thread Amit Langote
On 2017/10/13 4:18, Robert Haas wrote: > On Thu, Oct 5, 2017 at 9:29 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> Attached a patch to modify the INFO messages in check_default_allows_bound. > > Committed. However, I didn't see a reason to adopt the comme

Re: [HACKERS] [POC] hash partitioning

2017-10-11 Thread Amit Langote
On 2017/09/30 1:53, Robert Haas wrote: > On Thu, Sep 28, 2017 at 1:54 AM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> I looked into how satisfies_hash_partition() works and came up with an >> idea that I think will make constraint exclusion work. What i

Re: [HACKERS] v10 bottom-listed

2017-10-05 Thread Amit Langote
On 2017/10/05 22:28, Erik Rijkers wrote: > In the 'ftp' listing, v10 appears at the bottom: >   https://www.postgresql.org/ftp/source/ > > With all the other v10* directories at the top, we could get a lot of > people installing wrong binaries... > > Maybe it can be fixed so that it appears at

Re: [HACKERS] Optimise default partition scanning while adding new partition

2017-10-05 Thread Amit Langote
On 2017/10/06 2:25, Robert Haas wrote: > On Tue, Sep 26, 2017 at 4:27 AM, Amit Langote wrote: >> I guess we don't need to squash, as they could be seen as implementing >> different features. Reordering the patches helps though. So, apply them >> in this order: >&

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-10-03 Thread Amit Langote
On 2017/10/04 4:27, Robert Haas wrote: > On Tue, Oct 3, 2017 at 8:57 AM, Ashutosh Bapat > wrote: >>> Regarding nomenclature and my previous griping about wisdom, I was >>> wondering about just calling this a "partition join" like you have in >>> the regression

Re: [HACKERS] path toward faster partition pruning

2017-10-02 Thread Amit Langote
Hi David. Thanks a lot for your review comments and sorry it took me a while to reply. On 2017/09/28 18:16, David Rowley wrote: > On 27 September 2017 at 14:22, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> - 0001 includes refactoring that Dilip proposed upthr

Re: [HACKERS] Commitfest 201709 is now closed

2017-10-02 Thread Amit Langote
On 2017/10/03 7:16, Michael Paquier wrote: > On Tue, Oct 3, 2017 at 1:23 AM, Alexander Korotkov > wrote: >> On Mon, Oct 2, 2017 at 6:57 PM, Tom Lane wrote: >>> >>> Daniel Gustafsson writes: Thanks to everyone who participated,

Re: [HACKERS] path toward faster partition pruning

2017-10-01 Thread Amit Langote
On 2017/09/30 1:28, Robert Haas wrote: > On Thu, Sep 28, 2017 at 5:16 AM, David Rowley > wrote: >> I'd imagine, for >> each partition key, you'd want to store a Datum with the minimum and >> maximum possible value based on the quals processed. If either the >>

Re: [HACKERS] Partitions: \d vs \d+

2017-09-28 Thread Amit Langote
On 2017/09/28 22:19, Maksim Milyutin wrote: > I also noticed ambiguity in printing "No partition constraint" in > non-verbose mode and "Partition constraint:..." in verbose one for > partition tables regardless of the type of partition. > Attached small patch removes any output about partition

Re: [HACKERS] Partitions: \d vs \d+

2017-09-28 Thread Amit Langote
On 2017/09/28 22:29, Jesper Pedersen wrote: > On 09/28/2017 09:19 AM, Maksim Milyutin wrote: >>> E.g. "No partition constraint" vs. "Partition constraint: >>> satisfies_hash_partition(...)". >> >> I also noticed ambiguity in printing "No partition constraint" in >> non-verbose mode and "Partition

Re: [HACKERS] path toward faster partition pruning

2017-09-28 Thread Amit Langote
On 2017/09/28 13:58, Dilip Kumar wrote: > On Wed, Sep 27, 2017 at 6:52 AM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: > > I was looking into the latest patch set, seems like we can reuse some > more code between this path and runtime pruning[1] > > + fo

Re: [HACKERS] PartitionSchemaData & partcollation (Re: [COMMITTERS] pgsql: Associate partitioning information with each RelOptInfo.)

2017-09-28 Thread Amit Langote
On 2017/09/28 16:13, Ashutosh Bapat wrote: > On Thu, Sep 28, 2017 at 11:47 AM, Amit Langote wrote: >> On 2017/09/21 12:42, Robert Haas wrote: >>> Associate partitioning information with each RelOptInfo. >>> >>> This is not used for anything yet, but it is necess

Re: [HACKERS] Use of RangeVar for partitioned tables in autovacuum

2017-09-28 Thread Amit Langote
Thanks Michael for working on this. On 2017/09/27 11:28, Michael Paquier wrote: > Hi all, > > I have been looking more closely at the problem in $subject, that I > have mentioned a couple of times, like here: >

Re: [HACKERS] PartitionSchemaData & partcollation (Re: [COMMITTERS] pgsql: Associate partitioning information with each RelOptInfo.)

2017-09-28 Thread Amit Langote
Sorry, I meant to say PartitionSchem"e"Data in subject. Thanks, Amit -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

[HACKERS] PartitionSchemaData & partcollation (Re: [COMMITTERS] pgsql: Associate partitioning information with each RelOptInfo.)

2017-09-28 Thread Amit Langote
On 2017/09/21 12:42, Robert Haas wrote: > Associate partitioning information with each RelOptInfo. > > This is not used for anything yet, but it is necessary infrastructure > for partition-wise join and for partition pruning without constraint > exclusion. > > Ashutosh Ba

Re: [HACKERS] [POC] hash partitioning

2017-09-27 Thread Amit Langote
On 2017/09/27 22:41, Jesper Pedersen wrote: > On 09/27/2017 03:05 AM, amul sul wrote: Attached rebased patch, thanks. >>> While reading through the patch I thought it would be better to keep >>> MODULUS and REMAINDER in caps, if CREATE TABLE was in caps too in order to >>> highlight

Re: [HACKERS] path toward faster partition pruning

2017-09-26 Thread Amit Langote
Hi Jesper. Firstly, thanks for looking at the patch. On 2017/09/26 22:00, Jesper Pedersen wrote: > Hi Amit, > > On 09/15/2017 04:50 AM, Amit Langote wrote: >> On 2017/09/15 11:16, Amit Langote wrote: >>> I will post rebased patches later today, although I thin

Re: [HACKERS] path toward faster partition pruning

2017-09-26 Thread Amit Langote
Hi David, On 2017/09/27 6:04, David Rowley wrote: > On 25 September 2017 at 23:04, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> By the way, I'm now rebasing these patches on top of [1] and will try to >> merge your refactoring patch in some appropriate way. Wi

Re: [HACKERS] path toward faster partition pruning

2017-09-26 Thread Amit Langote
On 2017/09/27 1:51, Robert Haas wrote: > On Tue, Sep 26, 2017 at 10:57 AM, Jesper Pedersen > wrote: >> One could advocate (*cough*) that the hash partition patch [1] should be >> merged first in order to find other instances of where other CommitFest >> entries doesn't

Re: [HACKERS] path toward faster partition pruning

2017-09-26 Thread Amit Langote
On 2017/09/25 20:21, Dilip Kumar wrote: > On Mon, Sep 25, 2017 at 3:34 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: > >> Thanks for looking at the patches and the comments. > >> It's not clear to me whether get_rel_partitions() itself, as it i

Re: [HACKERS] Shaky coding for vacuuming partitioned relations

2017-09-26 Thread Amit Langote
On 2017/09/26 11:12, Michael Paquier wrote: > On Tue, Sep 26, 2017 at 10:54 AM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> I think that's right, although, I don't see any new RangeVar created under >> vacuum() at the moment. Maybe, you're referri

Re: [HACKERS] Shaky coding for vacuuming partitioned relations

2017-09-26 Thread Amit Langote
On 2017/09/26 11:14, Michael Paquier wrote: > On Tue, Sep 26, 2017 at 10:55 AM, Amit Langote wrote: >> On 2017/09/26 9:51, Michael Paquier wrote: >>> On Tue, Sep 26, 2017 at 8:48 AM, Michael Paquier wrote: >>>> Something like that looks like a good compromise fo

Re: [HACKERS] Optimise default partition scanning while adding new partition

2017-09-26 Thread Amit Langote
On 2017/09/16 1:57, Amit Langote wrote: > On Sat, Sep 16, 2017 at 12:59 AM, Robert Haas <robertmh...@gmail.com> wrote: >> I believe the intended advantage of the current system is that if you >> specify multiple operations in a single ALTER TABLE command, you only >> do

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-26 Thread Amit Langote
On 2017/09/26 16:30, Michael Paquier wrote: > On Tue, Sep 26, 2017 at 4:22 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >>> Except that small thing, the patches do their duty. >> >> Thanks, revised patches attached. > > Cool, let's switch

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-26 Thread Amit Langote
On 2017/09/26 12:17, Michael Paquier wrote: > On Mon, Sep 25, 2017 at 3:48 PM, Amit Langote wrote: >> So, ISTM, comments that the patches add should all say that setting the >> meta pages' pd_lower to the correct value helps to pass those pages to >> xlog.c as compressible

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-26 Thread Amit Langote
On 2017/09/26 11:34, Amit Kapila wrote: > On Mon, Sep 25, 2017 at 12:18 PM, Amit Langote wrote: >> So, ISTM, comments that the patches add should all say that setting the >> meta pages' pd_lower to the correct value helps to pass those pages to >> xlog.c as compressible

Re: [HACKERS] moving some partitioning code to executor

2017-09-25 Thread Amit Langote
On 2017/09/14 16:13, Amit Langote wrote: > Hi. > > It seems to me that some of the code in partition.c is better placed > somewhere under the executor directory. There was even a suggestion > recently [1] to introduce a execPartition.c to house some code around > tuple-routing.

Re: [HACKERS] Shaky coding for vacuuming partitioned relations

2017-09-25 Thread Amit Langote
On 2017/09/26 9:51, Michael Paquier wrote: > On Tue, Sep 26, 2017 at 8:48 AM, Michael Paquier > wrote: >> On Mon, Sep 25, 2017 at 11:32 PM, Tom Lane wrote: >>> Yeah, I'd noticed that while reviewing the vacuum-multiple-tables patch. >>> My thought

Re: [HACKERS] Shaky coding for vacuuming partitioned relations

2017-09-25 Thread Amit Langote
On 2017/09/25 18:37, Michael Paquier wrote: > On Mon, Sep 25, 2017 at 4:42 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> On 2017/09/25 12:10, Michael Paquier wrote: >> Hmm, I'm not sure if we need to lock the partitions, too. Locks taken by >> find

Re: [HACKERS] path toward faster partition pruning

2017-09-25 Thread Amit Langote
Hi Dilip. Thanks for looking at the patches and the comments. On 2017/09/16 18:43, Dilip Kumar wrote: > On Fri, Sep 15, 2017 at 2:20 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> On 2017/09/15 11:16, Amit Langote wrote: > > Thanks for the updated pat

Re: [HACKERS] Shaky coding for vacuuming partitioned relations

2017-09-25 Thread Amit Langote
On 2017/09/25 12:10, Michael Paquier wrote: > On Sat, Sep 23, 2017 at 4:13 AM, Tom Lane wrote: >> Somebody inserted this into vacuum.c's get_rel_oids(): >> >> tuple = SearchSysCache1(RELOID, ObjectIdGetDatum(relid)); >> if (!HeapTupleIsValid(tuple)) >>

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-25 Thread Amit Langote
Hi. Trying to catch up. On 2017/09/25 13:43, Michael Paquier wrote: > On Sun, Sep 24, 2017 at 2:25 PM, Amit Kapila wrote: >> Added and updated the comments for both btree and hash index patches. > > I don't have real complaints about this patch, this looks fine to me.

Re: [HACKERS] path toward faster partition pruning

2017-09-15 Thread Amit Langote
On Sat, Sep 16, 2017 at 4:04 AM, Robert Haas <robertmh...@gmail.com> wrote: > On Fri, Sep 15, 2017 at 4:50 AM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> Rebased patches attached. Because Dilip complained earlier today about >> clauses of the f

Re: [HACKERS] Optimise default partition scanning while adding new partition

2017-09-15 Thread Amit Langote
On Sat, Sep 16, 2017 at 12:59 AM, Robert Haas <robertmh...@gmail.com> wrote: > On Fri, Sep 15, 2017 at 2:00 AM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> I wonder if we should call check_default_allows_bound() from >> ATExecAttachPartition(), too,

Re: [HACKERS] no test coverage for ALTER FOREIGN DATA WRAPPER name HANDLER ...

2017-09-15 Thread Amit Langote
On Fri, Sep 15, 2017 at 9:20 PM, Robert Haas wrote: > On Thu, Sep 14, 2017 at 8:30 AM, Ashutosh Bapat > wrote: >> LGTM. The patch applies cleanly on the current HEAD, compiles (small >> bit in regress.c requires compilation), and make check

Re: [HACKERS] path toward faster partition pruning

2017-09-15 Thread Amit Langote
On 2017/09/15 11:16, Amit Langote wrote: > I will post rebased patches later today, although I think the overall > design of the patch on the planner side of things is not quite there yet. > Of course, your and others' feedback is greatly welcome. Rebased patches attached. Beca

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-15 Thread Amit Langote
On 2017/09/14 16:00, Michael Paquier wrote: > On Wed, Sep 13, 2017 at 4:43 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> Sure, no problem. > > OK, I took a closer look at all patches, but did not run any manual > tests to test the co

Re: [HACKERS] Race between SELECT and ALTER TABLE NO INHERIT

2017-09-15 Thread Amit Langote
On 2017/09/15 15:36, Amit Langote wrote: > The fact that > parent is locked after the child and with ShareUpdateExclusiveLock instead > of AccessExclusiveLock, we observe this race condition when SELECTing from > the parent. Oops, I meant "parent table is locked with Access

Re: [HACKERS] Race between SELECT and ALTER TABLE NO INHERIT

2017-09-15 Thread Amit Langote
Hi. On 2017/08/28 18:28, Kyotaro HORIGUCHI wrote: > << the following is another topic >> > BTW, in the partitioned table case, the parent is always locked first using an AccessExclusiveLock. There are other considerations in that case such as needing to recreate the partition

Re: [HACKERS] Optimise default partition scanning while adding new partition

2017-09-15 Thread Amit Langote
On 2017/09/15 0:59, Robert Haas wrote: > On Thu, Sep 14, 2017 at 4:03 AM, Jeevan Ladhe > wrote: >> Thanks Amit for reviewing. >>> Patch looks fine to me. By the way, why don't we just say "Can we skip >>> scanning part_rel?" in the comment before the newly added

Re: [HACKERS] path toward faster partition pruning

2017-09-14 Thread Amit Langote
Hi Dilip, Thanks for looking at the patch. On 2017/09/15 13:43, Dilip Kumar wrote: > On Wed, Sep 6, 2017 at 4:08 PM, Amit Langote >> [PATCH 2/5] WIP: planner-side changes for partition-pruning >> >> This patch adds a stub get_partitions_for_keys in partition.c with a

Re: [HACKERS] path toward faster partition pruning

2017-09-14 Thread Amit Langote
On 2017/09/15 10:55, David Rowley wrote: > On 21 August 2017 at 18:37, Amit Langote <langote_amit...@lab.ntt.co.jp> > wrote: >> I've been working on implementing a way to perform plan-time >> partition-pruning that is hopefully faster than the current method of >&

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-14 Thread Amit Langote
On 2017/09/15 4:43, Robert Haas wrote: > On Thu, Sep 14, 2017 at 8:06 AM, Ashutosh Bapat > wrote: >> I have few changes to multi-level expansion patch as per discussion in >> earlier mails > > OK, I have committed >

Re: [HACKERS] expanding inheritance in partition bound order

2017-09-14 Thread Amit Langote
On 2017/09/15 1:37, Robert Haas wrote: > On Thu, Sep 14, 2017 at 7:56 AM, Amit Khandekar <amitdkhan...@gmail.com> > wrote: >> On 14 September 2017 at 06:43, Amit Langote >>> langote_amit...@lab.ntt.co.jp> wrote: >>> Attached updated patch. >> &

Re: [HACKERS] Re: [COMMITTERS] pgsql: Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition b

2017-09-14 Thread Amit Langote
On 2017/09/14 16:53, Dean Rasheed wrote: > On 13 September 2017 at 10:05, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> Coincidentally, I just wrote the patch for canonicalizing stored values, >> instead of erroring out. Please see attached if that's what

Re: [HACKERS] moving some partitioning code to executor

2017-09-14 Thread Amit Langote
Repeating links for better accessibility: On 2017/09/14 16:13, Amit Langote wrote: > [1] https://www.postgresql.org/message-id/CA%2BTgmoafr%3DhUrM%3Dcbx-k%3DBDHOF2OfXaw95HQSNAK4mHBwmSjtw%40mail.gmail.com > [2] https://www.postgresql.org/message-id/7fe0007b-7ad1-a593-df11-ad0536

[HACKERS] moving some partitioning code to executor

2017-09-14 Thread Amit Langote
Hi. It seems to me that some of the code in partition.c is better placed somewhere under the executor directory. There was even a suggestion recently [1] to introduce a execPartition.c to house some code around tuple-routing. IMO, catalog/partition.c should present an interface for handling

Re: [HACKERS] Optimise default partition scanning while adding new partition

2017-09-13 Thread Amit Langote
art of the > default partitioning support. Patch looks fine to me. By the way, why don't we just say "Can we skip scanning part_rel?" in the comment before the newly added call to PartConstraintImpliedByRelConstraint()? We don't need to repeat the explanation of what it does at

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

2017-09-13 Thread Amit Langote
On 2017/08/07 11:05, Amit Langote wrote: > By the way, bulk of 0004 is refactoring which it seems is what Jeevan's > default partition patch set also includes as one of the patches [1]. It > got a decent amount review from Ashutosh. I broke it down into a separate > patch, so th

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-13 Thread Amit Langote
On 2017/09/14 7:43, Robert Haas wrote: > On Wed, Sep 13, 2017 at 12:56 PM, Ashutosh Bapat > wrote: >> I debugged what happens in case of query "select 1 from t1 union all >> select 2 from t1;" with the current HEAD (without multi-level >> expansion patch

Re: [HACKERS] expanding inheritance in partition bound order

2017-09-13 Thread Amit Langote
On 2017/09/14 1:42, Robert Haas wrote: > On Wed, Sep 13, 2017 at 6:02 AM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> It seems to me we don't really need the first patch all that much. That >> is, let's keep PartitionDispatchData the way it is for now, since

Re: [HACKERS] expanding inheritance in partition bound order

2017-09-13 Thread Amit Langote
On 2017/09/11 18:56, Amit Langote wrote: > Attached updated patch does it that way for both partitioned table indexes > and leaf partition indexes. Thanks for pointing it out. It seems to me we don't really need the first patch all that much. That is, let's keep PartitionDispatchData t

Re: [HACKERS] Re: [COMMITTERS] pgsql: Use MINVALUE/MAXVALUE instead of UNBOUNDED for range partition b

2017-09-13 Thread Amit Langote
Hi Dean, On 2017/09/13 17:51, Dean Rasheed wrote: > Robert Haas writes: >> On Tue, Sep 12, 2017 at 9:58 AM, Alvaro Herrera >> wrote: >>> Did anything happen on this, or did we just forget it completely? >> >> I forgot it. :-( >> >> I really

Re: [HACKERS] no test coverage for ALTER FOREIGN DATA WRAPPER name HANDLER ...

2017-09-13 Thread Amit Langote
On 2017/09/13 16:59, Ashutosh Bapat wrote: > On Wed, Sep 13, 2017 at 1:27 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> On 2017/09/13 16:42, Ashutosh Bapat wrote: >>> On Wed, Sep 13, 2017 at 7:49 AM, Amit Langote wrote: >>>> In the attached up

Re: [HACKERS] no test coverage for ALTER FOREIGN DATA WRAPPER name HANDLER ...

2017-09-13 Thread Amit Langote
On 2017/09/13 16:42, Ashutosh Bapat wrote: > On Wed, Sep 13, 2017 at 7:49 AM, Amit Langote wrote: >> In the attached updated patch, I created separate .source files in >> src/test/regress/input and output directories called fdw_handler.source >> and put the test_fdw_handle

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-13 Thread Amit Langote
On 2017/09/13 16:20, Michael Paquier wrote: > On Wed, Sep 13, 2017 at 2:48 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> I updated the patches so that the metapage's pd_lower is set to the >> correct value just before *every* point where we are about to ins

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-13 Thread Amit Langote
On 2017/09/13 16:21, Ashutosh Bapat wrote: > On Wed, Sep 13, 2017 at 12:39 AM, Robert Haas wrote: >> locks taken from the executor are worthless because plancache.c will >> always do the job for us. I don't know of a case where we execute a >> saved plan without going

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-13 Thread Amit Langote
On 2017/09/12 19:56, Ashutosh Bapat wrote: > I think the code here expects the original parent_rte and not the one > we set around line 1169. > > This isn't a bug right now, since both the parent_rte s have same > content. But I am not sure if that will remain to be so. Here's patch > to fix the

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-12 Thread Amit Langote
On 2017/09/13 13:05, Tom Lane wrote: > Amit Langote <langote_amit...@lab.ntt.co.jp> writes: >> On 2017/09/12 23:27, Amit Kapila wrote: >>> I think one point which might be missed is that the patch needs to >>> modify pd_lower for all usages of metapage, n

Re: [HACKERS] Race between SELECT and ALTER TABLE NO INHERIT

2017-09-12 Thread Amit Langote
On 2017/09/13 12:05, Simon Riggs wrote: > On 26 June 2017 at 10:16, Amit Langote <langote_amit...@lab.ntt.co.jp> wrote: > >> BTW, in the partitioned table case, the parent is always locked first >> using an AccessExclusiveLock. There are other considerations in that

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-12 Thread Amit Langote
Thanks for the review. On 2017/09/12 23:27, Amit Kapila wrote: > On Tue, Sep 12, 2017 at 3:51 PM, Amit Langote wrote: >> I updated the patches for GIN, BRIN, and SP-GiST to include the following >> changes: >> >> 1. Pass REGBUF_STNADARD flag when registering the met

Re: [HACKERS] no test coverage for ALTER FOREIGN DATA WRAPPER name HANDLER ...

2017-09-12 Thread Amit Langote
On 2017/09/12 20:17, Ashutosh Bapat wrote: > On Tue, Sep 12, 2017 at 2:27 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> Thanks Ashutosh for taking a look at this. >> >> On 2017/09/05 21:16, Ashutosh Bapat wrote: >>> The patch needs a rebase. &g

Re: [HACKERS] dropping partitioned tables without CASCADE

2017-09-12 Thread Amit Langote
On 2017/09/06 19:14, Amit Langote wrote: > On 2017/09/06 18:46, Rushabh Lathia wrote: >> Okay, I have marked this as ready for committer. > > Thanks Ashutosh and Rushabh for rebasing and improving the patch. Looks > good to me too. Patch needed to be rebased after the defaul

Re: [HACKERS] Setting pd_lower in GIN metapage

2017-09-12 Thread Amit Langote
On 2017/09/11 18:13, Michael Paquier wrote: > On Mon, Sep 11, 2017 at 5:40 PM, Amit Langote wrote: >> On 2017/09/10 15:22, Michael Paquier wrote: >>> Coordinating efforts here would be nice. If you, Amit K, are taking >>> care of a patch for btree and hash, would

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-12 Thread Amit Langote
On 2017/09/12 18:49, Ashutosh Bapat wrote: > On Tue, Sep 12, 2017 at 2:17 PM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> >> That said, I noticed that we might need to be careful about what the value >> of the root parent's PlanRowMark's allMarkTy

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-12 Thread Amit Langote
On 2017/09/12 17:53, Ashutosh Bapat wrote: > On Tue, Sep 12, 2017 at 1:42 PM, Amit Langote wrote: >> So, we can remove partitioned_rels from (Merge)AppendPath and >> (Merge)Append nodes and remove ExecLockNonLeafAppendTables(). > > Don't we need partitioned_r

Re: [HACKERS] no test coverage for ALTER FOREIGN DATA WRAPPER name HANDLER ...

2017-09-12 Thread Amit Langote
Thanks Ashutosh for taking a look at this. On 2017/09/05 21:16, Ashutosh Bapat wrote: > The patch needs a rebase. Attached rebased patch. Thanks, Amit From 75bcb6ebcc00193cb0251fced994f03d205e9e7f Mon Sep 17 00:00:00 2001 From: amit Date: Wed, 10 May 2017 10:37:42

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-12 Thread Amit Langote
On 2017/09/12 16:39, Ashutosh Bapat wrote: > On Tue, Sep 12, 2017 at 7:31 AM, Amit Langote > <langote_amit...@lab.ntt.co.jp> wrote: >> On 2017/09/11 19:45, Ashutosh Bapat wrote: >>> On Mon, Sep 11, 2017 at 12:16 PM, Amit Langote wrote: >>>> IMHO, we should m

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-12 Thread Amit Langote
On 2017/09/12 16:55, Ashutosh Bapat wrote: > On Tue, Sep 12, 2017 at 1:16 PM, Amit Langote wrote: >> So I looked at this a bit closely and came to the conclusion that we may >> not need to keep partitioned table RT indexes in the >> (Merge)Append.partitioned_rels after all

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-12 Thread Amit Langote
On 2017/09/11 21:07, Ashutosh Bapat wrote: > On Mon, Sep 11, 2017 at 5:19 PM, Robert Haas wrote: >> On Mon, Sep 11, 2017 at 6:45 AM, Ashutosh Bapat >> wrote: >>> So, all partitioned partitions are getting locked correctly. Am I >>> missing

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-11 Thread Amit Langote
On 2017/09/11 19:45, Ashutosh Bapat wrote: > On Mon, Sep 11, 2017 at 12:16 PM, Amit Langote wrote: >> IMHO, we should make it the responsibility of the future patch to set a >> child PlanRowMark's prti to the direct parent's RT index, when we actually >> know that it's need

Re: [HACKERS] expanding inheritance in partition bound order

2017-09-11 Thread Amit Langote
Hi Amit, On 2017/09/11 16:16, Amit Khandekar wrote: > Thanks Amit for the patch. I am still reviewing it, but meanwhile > below are a few comments so far ... Thanks for the review. > + next_parted_idx += (list_length(*pds) - next_parted_idx - 1); > > I think this can be replaced just by : >

Re: [HACKERS] Partition-wise join for join between (declaratively) partitioned tables

2017-09-11 Thread Amit Langote
On 2017/09/11 16:23, Ashutosh Bapat wrote: > On Sat, Sep 9, 2017 at 6:28 AM, Robert Haas wrote: >> I'm a bit suspicious about the fact that there are now executor >> changes related to the PlanRowMarks. If the rowmark's prti is now the >> intermediate parent's RT index

  1   2   3   4   5   6   7   8   9   10   >