public inbox for [email protected]  
help / color / mirror / Atom feed
From: Akshay Joshi <[email protected]>
To: Shirley Wang <[email protected]>
Cc: pgadmin-hackers <[email protected]>
Subject: Re: Declarative partitioning in pgAdmin4
Date: Mon, 22 May 2017 14:58:09 +0530
Message-ID: <CANxoLDfjy6sWQVHy5m5Rj1R5_=x_XwPzz6Mndj3xXfnEYpU_zg@mail.gmail.com> (raw)
In-Reply-To: <CAPG3WN5QA88fNmY4jZZhBY+HUn2FAKecHuvyFjnq2x_vGu4_0w@mail.gmail.com>
References: <CANxoLDcZND0pjXtrDKRip2xjddzjWiMgY2AMmrqqFE_Yu4+tHw@mail.gmail.com>
	<CA+OCxowUuaNRX9jHmEVFpqT7JCbjn6vaxw+JJ6yrvVp69FZscg@mail.gmail.com>
	<CAPG3WN5NY-Xsa_+6HUQ3NMU_n7jRgJ8L6rjHfyzSLSHS=zZC0Q@mail.gmail.com>
	<CA+OCxoy1v+mq2P4ZL2v7mmyHmjwQmL=v8RR8CSRra_SV96nJDQ@mail.gmail.com>
	<CANxoLDeBGRmq_kUUNNySXimzJO2Ebj0aQBdjNM+0JvP3_Yr9Dw@mail.gmail.com>
	<CAAtBm9Ve2FX4_jY9tv11UqK2BhNoLn118aeT4y=TieSAovL+AA@mail.gmail.com>
	<CA+OCxozkEdTmVUtJEBdHT97EbiUK_+cwW+rv21tuHyxSnN3HOg@mail.gmail.com>
	<CAAtBm9UHyp+bkxcyYL+1qb9knps_cdh6N0tvwMy5uY-eVjWcPg@mail.gmail.com>
	<CANxoLDdgp46uAZzda+cHBn16YibodXgtyH7O1hp39TKT=cv_ig@mail.gmail.com>
	<CA+OCxowpGBLT1q2DzL9VpRG5So8zYssP9SAdd=3Mc6dk8_-p7A@mail.gmail.com>
	<CANxoLDdP945GEfzeYaPjO41D4VoRN2kDMVhHZCOqCXWKegSEHw@mail.gmail.com>
	<CA+OCxowCzLAFybtfnsay9NB0BFORP5yXiitruxh9tvMoADNKRQ@mail.gmail.com>
	<CANxoLDcqudMZ5j-30EcFEL9KpQxyvrMWo0mVrWdg0p6_8e7peQ@mail.gmail.com>
	<CA+OCxow5pXNkDxrL1dbWbheJjpSseefSdvUs5tiwx7k5o3vB7Q@mail.gmail.com>
	<CANxoLDeNovspn8mm0XuYh+F2ShGotwRCAikU5JY9qF1GgFQ9rg@mail.gmail.com>
	<CA+OCxowtH1WJpXA1MKSLrzx_qbKAA36GTEk1t5=3VAS8fegBiA@mail.gmail.com>
	<CANxoLDeLHGvz0NxH_MM7dCe0muA8Sxe54V65b18iHTAESzt97g@mail.gmail.com>
	<CANxoLDeuXKCqrdNwiBut5m7FKQwzRjbPrqR6wHf8qKqgLDnwgQ@mail.gmail.com>
	<CAPG3WN4tiMGoFadBZ9KjB8NfNDVfvDnfUHhS=aya5A0o-jZ3Xw@mail.gmail.com>
	<CANxoLDfN_RvNc0AsVCtrDC-03L53crHzE8JZjmxna3f08KWVqw@mail.gmail.com>
	<CAPG3WN5QA88fNmY4jZZhBY+HUn2FAKecHuvyFjnq2x_vGu4_0w@mail.gmail.com>
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi All

As continuation I have worked on "Partition" Tab and added some controls
where user will be able to specify the key columns and create N number of
partitions:

   - Added Partition Type combo box where user will define the
   Type(Range/List)
   - "Partition Keys" subnode control where there is combo box to specify
   it is column or expression. If it is column then on expanding subnode
   control all the columns specified to create main table will be listed here.
   User won't be able to select multiple columns here. If it is expression
   then user will be able to specify correct expression with correct
   parenthesis. In case of List partition only one row will be allowed.
   - "Partitions" control is used to create N number of partitions. In case
   of Range partition there are three columns "Name", "Value From" and "Value
   To". If partition key is combination of multiple columns or combination of
   column and expression then user will have to provide (,) comma separated
   values. Refer "*Range_Partition.png*". In case of List partition there
   are two columns "Name" and "Values In" and user will have to provide (,)
   separated list for "Values In" column. Refer "*List_Partition.png*".

*Note*: Apart from above there are following that needs to be taken care:

   - Once user will define the partition keys and partitions based on the
   columns define for main table and then user will rename/delete any column
   from "Columns" Tab we will warn user about renaming/deleting any column
   will reset all the rows define under partitions tab. This is just because
   we can rename/delete the column from partition keys but not sure how we can
   remove/rename it from the expression defined by the user.
   - *Major challenge* here is while creating partitions(second subnode
   control in attached image) according to the documentation user will be able
   to create constraints( Primary, Foreign, Unique...). How user will be able
   to add constraints from GUI? Do we need to implement a new control where
   one subnode control contains the whole "Constraints" Tab or any other
   solution.


Please review it. Suggestions/Comments are welcome.

On Fri, May 19, 2017 at 11:03 PM, Shirley Wang <[email protected]> wrote:

> On Fri, May 19, 2017 at 2:17 AM Akshay Joshi <
> [email protected]> wrote:
>
>> Hi Shirley
>>
>> On Thu, May 18, 2017 at 9:06 PM, Shirley Wang <[email protected]> wrote:
>>
>>> Hi Akshay!
>>>
>>> Is this the workflow that you think users are going to engage in given
>>> what you're building? Anne mentioned you're in the process of figuring out
>>> what's required for defining the partitions, so you'll notice pink boxes
>>> with text in areas where that might happen.
>>>
>>> The modules that appear for partitioning are based on the ones we saw a
>>> few weeks ago, let me know if that has changed in any way.
>>>
>>> *01 user creates a table, if one doesn't already exist*
>>> [image: create table.png]
>>>
>>>
>>> *02 user selects 'yes' for partitioning*[image: add partition.png]
>>>
>>>    Step 1 and 2 are correct.
>>
>>
>>
>>> *03 user defines type of partition and ranges*
>>> [image: define partition.png]
>>>
>>
>>    We will create a new tabs "Partitions" and 'Partition Type' combo will
>> go on that tab along with following controls:
>>
>>    - User should be able to specify Key Column(s) (Based on partition
>>    type) to create partitioned(parent) table. Some of the examples of list and
>>    range partitions are as below:
>>    - CREATE TABLE prt1 (a int, b int, c varchar) PARTITION BY RANGE(a);
>>       - CREATE TABLE prt1_e (a int, b int, c varchar) PARTITION BY
>>       RANGE(((a + b)/2));
>>       - CREATE TABLE prt1_m (a int, b int, c varchar) PARTITION BY
>>       RANGE(a, ((a + b)/2));
>>       - CREATE TABLE plt1 (a int, b int, c text) PARTITION BY LIST(c);
>>       - CREATE TABLE plt1_e (a int, b int, c text) PARTITION BY
>>       LIST(ltrim(c, 'A'));
>>       - User should be able to create N number of partitions:
>>
>>
>>    - Design one control (subnode control) so that user will add N number
>>       of partitions. Here is the syntax as per documentation CREATE  TABLE
>>        table_name PARTITION OF parent_table [ (   { column_name [ WITH OPTIONS ]
>>       [ column_constraint [ ... ] ]     | table_constraint }     [, ... ] ) ] FOR
>>       VALUES partition_bound_spec partition_bound_spec is:{ IN ( {
>>       bound_literal | NULL } [, ...] ) | FROM ( { bound_literal | UNBOUNDED } [,
>>       ...] ) TO ( { bound_literal | UNBOUNDED } [, ...] ) }
>>
>>
>>
>>    Design(GUI) discussion required for above two, which control should we
>> used so that user will be easily able to create N number of partitions.
>>
>
> Ok. Hopefully we'll get some interviews set up for next week that'll help
> us determine the best workflow for this.
>



-- 
*Akshay Joshi*
*Principal Software Engineer *



*Phone: +91 20-3058-9517Mobile: +91 976-788-8246*


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [image/png] create table.png (334.1K, 3-create%20table.png)
  download | view image

  [image/png] define partition.png (329.4K, 4-define%20partition.png)
  download | view image

  [image/png] add partition.png (330.2K, 5-add%20partition.png)
  download | view image

  [image/png] List_Partition.png (121.5K, 6-List_Partition.png)
  download | view image

  [image/png] Range_Partition.png (132.3K, 7-Range_Partition.png)
  download | view image

view thread (77+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Declarative partitioning in pgAdmin4
  In-Reply-To: <CANxoLDfjy6sWQVHy5m5Rj1R5_=x_XwPzz6Mndj3xXfnEYpU_zg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox