[Phpmyadmin-devel] Regarding RFE #908

Ashutosh Dhundhara ashutoshdhundhara at yahoo.com
Tue Jul 8 16:48:38 CEST 2014


On Tue, Jul 8, 2014 at 6:01 PM, Marc Delisle <marc at infomarc.info> wrote:

> Le 2014-07-08 07:52, Ashutosh Dhundhara a écrit :
> > Hi,
> >
> > I have got some ideas regarding RFE #908
> > <http://sourceforge.net/p/phpmyadmin/feature-requests/908/>
> (Improvements for
> > the table editor (index creation)).
> >
> > *_1. Making Column section on 'Add Index' dialog sort-able._*
> > With this user will be able to change the order of columns in case of
> > composite keys.
> >
> > *_2. Displaying a dialog box when multiple columns for same type of
> > index are selected on 'Create table' page._*
> > This dialog will have two options: 'Create new' and 'Create composite'.
> > - 'Create new' will allow user to create a new single column key. (Table
> > can have only one Primary key)
> > - 'Create composite' will allow user to add that column to a existing
> > key (to be created) and sort the order of columns.
> >
> > Will this implement this feature request?
>
> Hi Ashutosh,
> first, the feature request says "If I add two indexed fields to a
> table"; remember that this action can be done on initial table creation,
> and when adding columns on an existing table.
>

Thanks for pointing this out. I missed that 'adding column on an existing
table' part.


>
> About your suggestion #1, are you talking about the dialog that appears
> after choosing table Structure > Indexes > Create an index on x columns
> ? If so, the user can already choose the columns in the correct order;
> so you want to help the user change his mind when creating the index?
>
> I am not against, but this would be more useful when _editing_ an index.
> Or it can be done in both situations.
>
>

Yeah, this can be done with the existing system. I failed to see that.


About your suggestion #2, if the user chose PRIMARY in the selector for
> two columns, it makes no sense to show this additional dialog (unless
> you want him to confirm that the PRIMARY will be composite) but it makes
> sense to allow column sorting.
>

Yeah Marc, I won't show this dialog for PRIMARY key.


>
> If he chose UNIQUE or INDEX, instead of "Create new" I would say "Create
> single-column indexes". The other message could be "Create a composite
> index" but do you suggest that this choice opens the already-existing
> Edit index dialog, which you would prefill with the chosen column names?
>
> As per the feature request, the default choice should be to create
> single-column indexes.
>

I think you are getting it wrong. This part is for 'Create table' page and
'add column to existing table' page. Lets say I am creating a new table. I
have added a column `col1` and selected UNIQUE index for it (before
clicking 'Go'). I won't see any dialog yet. Now lets I have added another
column `col2` and selected UNIQUE index for this as well. Now I will get a
dialog asking for "Create single-column indexes" or "Create a composite
index". If I will choose "Create a composite index", then I will get a list
of all temporary UNIQUE indexes and I can merge that column into any of
these indexes.
For PRIMARY index, we will need only the composite-index part.

I think this will also handle the issue highlighted by you in the next mail?


>
> As I told to Smita for her project, it's better to reuse existing
> interfaces, in this case the existing index editor.


I believe that the existing index editor works for existing tables (ALTER
TABLE statement) but in this case we need to modify the CREATE TABLE query.
So no interaction required with the server yet. Still I will try to reuse
it, if possible.

-- 
Ashutosh Dhundhara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20140708/dee56c34/attachment.html>


More information about the Developers mailing list