Re: taking long time to ALTER the table
Posted by:
Rick James
Date: April 14, 2016 12:39PM
I do not have a handle on the "1 minute for 4M rows", but here are some things that should help.
It is generally not a good design to have "arrays" (such as multiple addresses, _01/_02, list of dates, etc) in a single table. It is better to have other tables, with a PRIMARY KEY that is a combination of the Primary key of this table, plus some other indicator. (For the addresses: 'c' vs 'rb'.)
Furthermore, everything(?) is NULL. This may imply that everything is optional. If so, then moving chunks of optional stuff to another table(s) could clean up the structure. Rather than having lots of NULLs in the other table, simply don't have the row. To put things back together, use LEFT JOIN.
There are 13 names.
ps_key vs ps_id ? Sounds redundant?
Curious... Your first output had a few dy_ fields; the CREATE TABLE has none. Probably the dy_ clump should be another table.
ALTERing a narrower/shorter table should be faster.
Subject
Views
Written By
Posted
1804
April 07, 2016 07:47AM
945
April 12, 2016 07:18PM
1049
April 13, 2016 03:08AM
970
April 13, 2016 08:54AM
967
April 13, 2016 09:23AM
1239
April 13, 2016 05:43PM
932
April 13, 2016 06:31PM
1035
April 14, 2016 12:23AM
Re: taking long time to ALTER the table
993
April 14, 2016 12:39PM
932
April 15, 2016 12:00AM
950
April 15, 2016 03:31PM
904
April 18, 2016 03:54AM
1094
April 14, 2016 01:40PM
969
April 14, 2016 02:08PM
Sorry, you can't reply to this topic. It has been closed.
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.