Skip to content

When specifying a table in input file, only select relevant data from information_schema #105

@sosso

Description

@sosso
LOAD DATABASE FROM mysql://root:root@localhost/mydb?mytable
 INTO postgresql://postgres:postgres@localhost/pgdb?public.mytable
INCLUDING ONLY TABLE NAMES MATCHING 'mytable';

Even though I'm only targeting one table, it generates the following query:

select c.table_name, c.column_name,
         c.data_type, c.column_type, c.column_default,
         c.is_nullable, c.extra
    from information_schema.columns c
         join information_schema.tables t using(table_schema, table_name)
   where c.table_schema = 'mydb' and t.table_type = 'BASE TABLE'
order by table_name, ordinal_position;

On my production system, that query takes 15 minutes, as we have a very large number of very wide tables; It would be great to add an additional where to only hit my specific table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions