From: Date: November 14 2007 2:51am Subject: Re: Alter table in 5.0.45 List-Archive: http://lists.mysql.com/cluster/5459 Message-Id: <12d754400711131751u3cad9559ydcfbde7a58c56eac@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8576_520708.1195005061817" ------=_Part_8576_520708.1195005061817 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline So I assume I would need enough data memory to make the temporary table - so if I have 6GB allocated to ndbd, and 3.2 GB used, I will not be able to add another column, even in single user mode? On 11/13/07, Matthew Montgomery wrote: > > Hello Jonathan, > > On Tue, 2007-11-13 at 12:07 -0800, Jonathan Haddad wrote: > > I'm setting up my first mysql cluster, and just wanted some > clarification on > > a few things. > > > > In the manual, it says: > > - > > *Online schema changes. * It is not possible to make online schema > > changes such as those accomplished using ALTER TABLE or CREATE INDEX, > > as the NDB Cluster engine does not support autodiscovery of such > > changes. (However, you can import or create a table that uses a > different > > storage engine, and then convert it to NDB using ALTER TABLE > *tbl_name > > * ENGINE=NDBCLUSTER. In such a case, you must issue a FLUSH > > TABLES statement to force the cluster to pick up the change.) > > > > > http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster-limitations-exclusive-to-cluster.html > > > > However, on the cluster limitations page, it says: > > > > *DDL operations. * DDL operations (such as CREATE TABLE or ALTER TABLE) > are > > not safe from data node failures. If a data node fails while trying to > > peform one of these, the data dictionary is locked and no further DDL > > statements can be executed without restarting the cluster. > > > > It's not clear to me whether or not I can alter tables. Can I add > columns > > and indexes once the cluster is being used? Thanks. > > Yes, you can alter the table. However, In 5.0 it is not an online > operation. NDB will need to lock the target table, create a temporary > table, copy all rows into it and rename the new on to the original ones > name. Also, The other mysqld nodes in the cluster will not > auto-discover the schema changes. You should put the cluster into > single user mode when doing schema changes. This will force all the SQL > nodes where the change was not issued on to reconnect and regenerate > their local cached copy of the table schemas. > > > -- > Matthew Montgomery, Support Engineer > San Antonio, TX > MySQL Inc, www.mysql.com > > -- Jon Haddad jon@stripped Letsgetnuts.com ------=_Part_8576_520708.1195005061817--