#1 2012-02-06 23:12:10

Roderick Smith
Guest

Missing Table Indexes

I have a job where all that needs to happen is take a table in a mysql database and copy it to a remote mysql server. I'm fairly new to talend and I'm using the Talend Open Studio.

Either way, I managed to get my copies going, in the tMysqlOutput component I'm using "Drop table if exist and create" under "action on table", however, while running queries on the data today I realized that when Talend creates the table the table in the target server does not have any of the indexes (except for the primary key, which is indeed there).

Is there an option somewhere in Talend where I can have it mirror the table exactly as it is? indexes, storage engine, etc included?

Thanks in advance for your help,

Roderick Smith

#2 2012-02-07 03:26:56

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Missing Table Indexes

Hi Roderick Smith

After dropping table and creating, you can use tMysqlRow to add indexes.
tMysqlInput-->tMysqlOutput
         |
OnSubjobOk
         |
tMysqlRow

Set query of tMysqlRow as follow.

Code:

ALTER TABLE tablename ADD INDEX index_name (column_list)

Regards,
Pedro


Only Paranoid Survive.

Offline

Board footer

Powered by FluxBB