OQGRAPH Graph Engine

Graph and hierarchy queries in SQL via ENGINE=OQGRAPH on MariaDB and MySQL-family servers.

OQGRAPH computes paths, reachability, and leaves over an edge table stored in a normal engine (typically InnoDB). Relational data stays relational. Graph operations stay in SQL — same clients, backups, and HA plane.

Use when

  • Org charts, category trees, BOM, ACL inheritance
  • Directed networks with optional edge weights
  • You need answers without operating a separate graph database

Contract

  1. Store edges in a backing table (origid, destid, optional weight).
  2. Create an OQGRAPH table bound with data_table / origid / destid [/ weight].
  3. Select with latch = dijkstras, breadth_first, or leaves.
SELECT GROUP_CONCAT(linkid ORDER BY seq) AS path
FROM oq_graph
WHERE latch='dijkstras' AND origid=1 AND destid=6;

Limits

  • Latch-driven API — not a general property-graph store
  • Not aimed at billion-edge analytical warehouses
  • Writes go only to the backing table
  • Query cache is unused

Links

Documentation ·Overview ·Examples ·Forum ·Contact