Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sql syntax for such queries is super awkward with tones of gottyas, not sure how performance compares


There's admittedly some ongoing work on extending the SQL standard syntax with some extra sugar for "Property Graph Query". But there's nothing wrong technically with just using basic SQL syntax, it's just a matter of getting it to work. Performance will vary depending on query optimizer, any INDEX definitions, etc. and is quite a separate concern.

Overall, graph databases are so general as a model that writing slow queries will always be a possibility, so one should be mindful of these concerns. But that's just as true in NoSQL graph db's.


Something I just found out after looking into status updates on the Property Graph Query (PGQ) work being done in SQL, is that it will exactly mirror the work going into GQL (Graph Query Language, a newish standard in its early stages of development based mostly off of Neo4j's Cypher).

To summarize this post[0] by someone involved with the standards:

- GQL (ISO/IEC 39075) is a full database language to create and manage property graphs and create, read, update, and delete nodes and edges (or vertices and relationships)

- SQL/PGQ (ISO/IEC 9075-16) is a new add-on part of the SQL standards which introduces the capabilities to create property graph views on top of existing tables in an SQL database, as well as the ability to query property graphs using a GRAPH_TABLE function in an SQL FROM clause

- The input to the SQL/PGQ GRAPH_TABLE function is a property graph query, sometimes referred to as Graph Pattern Matching or GPM. Graph Pattern Matching is common between SQL/PGQ and GQL. That is, the syntax accepted in a GRAPH_TABLE function in an SQL FROM clause is identical to the syntax in a GQL graph query. Because GPM is the same in both draft standards, changes to GPM for SQL/PGQ also apply to the GPM portions of the GQL specification.

---

I also just came across the Apache AGE project[1] which basically allows you right now to extend PostgreSQL DBs with property graph capabilities and enables full(?) use of Cypher/GQL.

[0] http://www.jcc.com/resources/jcc-blogs-menu/blog-database-dr...

[1] https://age.incubator.apache.org/


Also, nested sets and materialized paths have been around forever to do graphs inside SQL.


At the end of the day Neo4J needs to operate a query planner on top of a relatively standard index structure to present the graph abstraction. There is limited difference between Neo4j's planner and what could be planned from SQL.

GraphDBs make more sense when there is strong evidence that either the natural description of the program is a graph or that the underlying storage engine can efficiently model the graph.

So far no GraphDB has demonstrated either statements as true for the majority of problems.


Yeah, but it's free and open source.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: