Jump to content

Update Faster


Treterpeter

Recommended Posts

Hi guys,

 

Say I got two tables,

  • Table1 - columns A, B, C, flag - approx 200 000 rows
  • Table2 - columns A, B, C - approx 20 000 rows

What I want to do is:

  • Update Table1
    Set flag = 1
    Where "at least one row from Table2 has the same entries in columns
    A, B and C"

Right now I am solving this with a "select distinct A, B, C from Table2" and transform this into a long where condition (with php). afterwards I apply the above update with this where condition. However this aproche needs about 5 minutes to run and I believe this could be much faster when I just know the right MySql command for this.

 

Can anyone help me?

 

cheers,

Peter

Link to comment
https://forums.phpfreaks.com/topic/273823-update-faster/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.