NULL, destid INT UNSIGNED NOT NULL, weight DOUBLE NOT NULL, PRIMARY KEY (origid, destid), KEY (destid) ); INSERT INTO oq2_backing(origid, destid, weight) VALUES (1,2,1), (2,3,1), (3,4,3), (4,5,1), (2,6,10), (5,6,2); SELECT * FROM oq_graph WHERE latch='breadth_first' AND origid=1 AND destid=6; +----------+--------+--------+--------+------+--------+ | latch | origid | destid | weight | seq | linkid | +----------+--------+--------+--------+------+--------+ | dijkstras| 1 | 6 | NULL | 0 | 1 | | dijkstras| 1 | 6 | 1 | 1 | 2 | | dijkstras| 1 | 6 | 1 | 2 | 6 | +----------+--------+--------+--------+------+--------+ CREATE TABLE oq2_graph ( latch VARCHAR(32) NULL, origid BIGINT UNSIGNED NULL, destid BIGINT UNSIGNED NULL, weight DOUBLE NULL, seq BIGINT UNSIGNED NULL, linkid BIGINT UNSIGNED NULL, KEY (latch, origid, destid) USING HASH, KEY (latch, destid, origid) USING HASH ) ENGINE=OQGRAPH data_table='oq2_backing' origid='origid' destid='destid' weight='weight';