Best way to update weights on Graph (by mikemarr)
using MySQL version: 5.0.85-d10-ourdelta-sail
I have a graph in which I want to be able to dynamically update the weights of any edge from a given vertex.
Currently, there are ~115,000 connections.
I tried grabbing all the out- and in-edges for a given node and then for each relationship (as suggested from documentation):
UPDATE relationships SET weight = 100 WHERE destid = 1 and origid = 2;
However, this takes approximately 45 - 60 seconds per relationship.
I also tried this:
UPDATE relationships SET weight = 100 WHERE destid = 1 AND latch = 0;
Hoping to subsequently run the same command for departing edges. However, this is the error message I get:
ERROR 1194 (HY000): Table 'relationships' is marked as crashed and should be repaired