PostgreSQL Official News·· 27d ago
AgensGraph 2.18.6.1 Expands ISO GQL Support on PostgreSQL 18.6
AgensGraph 2.18 Released: Graph Database on PostgreSQL 18 with Expanded ISO GQL Support
Key Takeaway
AgensGraph 2.18.6.1 adds ISO GQL clauses alongside openCypher on PostgreSQL 18.6. With edge-label indexes used at each hop, a two-hop traversal on the 30-million-edge soc-Pokec graph finished in milliseconds in the team's test, versus not finishing within 20 seconds on 2.17.
Why It Matters
A two-hop test on the same graph across both versions illustrates how using edge-label indexes at each hop can cut traversal time.
Technical Breakdown · Distilled from the original source
ISO GQL clauses and graph subqueries
- AgensGraph 2.18.6.1 is based on PostgreSQL 18.6. SQL and graph queries can operate on the same data in one transaction, even within a single statement. This release introduces a subset of ISO GQL alongside openCypher:
LET,FOR,FILTER,NEXT,FINISH, andINSERT, plus standaloneORDER BY,OFFSET, andLIMIT. - Graph subquery forms include
CALL { },OPTIONAL CALL,EXISTS { },COUNT { },COLLECT { }, andVALUE { }. Cypher can invoke PostgreSQL functions throughCALL ... YIELD.
Traversal indexes, property columns, and row-level security
- Variable-length traversals now use the edge label's index at each hop. Version 2.17 scanned the entire label at every hop. In the team's test on the public soc-Pokec graph with 30 million edges, a two-hop traversal completed in milliseconds on the new release but did not finish within 20 seconds on 2.17.
- Frequently queried properties can be stored in native typed columns and indexed like other PostgreSQL columns to speed up filtering and sorting. Cypher writes now enforce row-level security policies. Fixed-length patterns also enforce row-level security and privileges on matched labels even when the pattern does not name them.
Python driver and vector queries
- Rebuilt on
psycopg3,agensgraph-python2.1 supports synchronous and asynchronous operation, runs Cypher and SQL in the same transaction, and returns vertices, edges, and paths as native Python objects. Query results can load directly into pandas, Polars, or Arrow. - With the separately installed
pgvectorextension, graph data and vector embeddings can reside in the same database, allowing a single query to combine graph traversal with vector similarity search.
Source: PostgreSQL Official News· postgresql.org
PG Radar summarizes verified changes and impact. Read the original post for full technical details and code samples.