- Code: Select all
UPDATE projects SET p_pre_financing = p_cost_actual - p_invoiced WHERE p_pre_financing <> p_cost_actual - p_invoiced
However after 100 seconds I stopped it, as it seemed to run forever.
But it should have changed just 70 records out of 39.000.
The SELECT to get those records needed just some miliseconds:
- Code: Select all
SELECT project_id FROM projects WHERE p_pre_financing <> p_cost_actual - p_invoiced
Then I got curious and fired
- Code: Select all
UPDATE projects SET p_pre_financing = p_cost_actual - p_invoiced WHERE project_id = <specific-UUID>
Again no termination, although project_id is the primary key of that table.
All three fields are of type 'double precision'.
What could be the cause?
If that happend in Foxpro, I would guess that the index was defect and caused a loop internally somehow.
Could that have happend here too?
Maybe that UPDATE command is first building a list of UUIDs for the WHERE-clause, and then has problems to run through that list due to a defect index?