fast update with 1:1 table?

fast update with 1:1 table?

am 10.04.2010 02:42:03 von Mitchell Maltenfort

I have two tables, A and B. B has newer data, A has more columns.

I want to update some of the columns in A with all but one of the
columns in B. They have the same number of records -- about eight
million -- and one key column in common for matching. (That's the one
from B I don't want to update)

I get the idea that using UPDATE...WHERE is not my fastest option.

Can anyone suggest an alternative?

Not sure about LOAD INFILE and REPLACE because they seem to cover entire rows.

Thanks in advance.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: fast update with 1:1 table?

am 10.04.2010 06:37:43 von Ananda Kumar

--001636e1f9110845b80483da7929
Content-Type: text/plain; charset=ISO-8859-1

use a stored proc, and commit at regular interval say, for every 1k rows.
This would be faster and if ur using slave, they will also commit at regular
interval and be in sync.

regards
anandkl

On Sat, Apr 10, 2010 at 6:12 AM, Mitchell Maltenfort wrote:

> I have two tables, A and B. B has newer data, A has more columns.
>
> I want to update some of the columns in A with all but one of the
> columns in B. They have the same number of records -- about eight
> million -- and one key column in common for matching. (That's the one
> from B I don't want to update)
>
> I get the idea that using UPDATE...WHERE is not my fastest option.
>
> Can anyone suggest an alternative?
>
> Not sure about LOAD INFILE and REPLACE because they seem to cover entire
> rows.
>
> Thanks in advance.
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=anandkl@gmail.com
>
>

--001636e1f9110845b80483da7929--