dagon;10990469 wrote:LIMIT 1 would stop a full table scan on each of the updates, then i assume location is indexed, while still not efficient i imagine this is a one of task not a regular occurrence. still seems a lot of time for so few rows.
the other option is a join\subqurry.
Thanks dagon.
Yes, location is indexed in the Location table and LoID is indexed in the PastSignings table.
Yes, this is a "1 off" type thing.
I don't see how LIMIT 1 would work on this.
$queryL = "SELECT location, loID FROM Locations LIMIT1" wouldn't work as it would only update 1 location and then stop.
$stmtL = mysqli_prepare($link, "UPDATE PastSignings SET loID = ? WHERE location = ? LIMIT 1") doesn't make sense to me either.
For a subquery do you mean
$queryL = "SELECT location, loID FROM Locations WHERE ("UPDATE PastSignings SET loID = ? WHERE location = ? )
But now I am mixing a bound parameter with a non-bound query.
EEEESH 😕