[MDEV-22507] OQGRAPH - Filter table using additional where clauses Created: 2020-05-08  Updated: 2020-09-13

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - OQGRAPH
Affects Version/s: 10.4.10
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Kevin Andrews Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Arch Linux



 Description   

It would be absolutely fantastic if records inside the base table of a oqgraph queried table could be filtered before applying the graph storage engine logic.

For example:

CREATE TABLE mapSolarSystemJumpsGraph
ENGINE=OQGRAPH 
data_table='mapSolarSystemJumps' origid='fromSolarSystemID' destid='toSolarSystemID';

SELECT * FROM mapSolarSystemJumpsGraph mssjg
WHERE latch='breadth_first' AND origid=30001429 AND destid=30001198 
AND toSolarSystemID <> 30001399 -- pass this through to the base table?

I've tried a few work around methods including targeting the oqgraph creation statement at temp tables and views, these create fine, but when queried give the table not found error. This could also be very useful.

One workaround which is working, not ideal though, is a transaction based delete on the base table data before running the oqgraph table query:

BEGIN;
DELETE FROM mapSolarSystemJumps WHERE toSolarSystemID = 30001399;
SELECT * FROM mapSolarSystemJumpsGraph mssjg
WHERE latch='breadth_first' AND origid=30001429 AND destid=30001198;
ROLLBACK;

Use case here is a routing query /system for a game where solar systems can have may jump gates to other solar systems. OQGRAPH's performance in this area is unmatched at milliseconds for a routed chain of 41 systems having an average of 4 different possible routes each.


Generated at Thu Feb 08 09:15:15 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.