Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for recursive queries (for graph / tree use-cases) #14568

Open
hpvd opened this issue Nov 29, 2024 · 4 comments
Open

Support for recursive queries (for graph / tree use-cases) #14568

hpvd opened this issue Nov 29, 2024 · 4 comments

Comments

@hpvd
Copy link

hpvd commented Nov 29, 2024

Support for recursive queries to use Pinot for typical graph use cases

Many DBs already support recursive queries for several years. This enable many graph / tree like queries with good performance
without the need for a dedicated graph database.

The with recursive clause is defined in ISO/IEC 9075-2:2023 §7.17 as part of optional feature T131

-> A good intro on

  • what it is and
  • what it made possible
  • with which syntax

can be found here:
https://www.linkedin.com/pulse/you-dont-need-graph-database-modeling-graphs-trees-viktor-qvarfordt-efzof/

databases with support for recursive queries are, e.g.

see https://modern-sql.com/caniuse/with_recursive_(top_level)

and https://en.wikipedia.org/wiki/Hierarchical_and_recursive_queries_in_SQL

=> Is there way to make this happen for Pinot too?
Or is this hardly possible with our architecture?

@hpvd hpvd changed the title Support for recursive queries Support for recursive queries (graph / tree like) Nov 29, 2024
@hpvd
Copy link
Author

hpvd commented Nov 30, 2024

Motivation:

for using Pinot (or any other non graph native DB) for typical Graph-Usecases like

  • deep personalisation
  • social networks
  • RAG
  • fraud detection

-> making it possible to build systems without having to use an additional database type like neo4j
which saves lots of effort during dev and maintenance and even costs.
In addition its much easier to build a team being expert in one tech stack than in two...

@hpvd
Copy link
Author

hpvd commented Nov 30, 2024

Is this realistic from a performance pov in production?

imho for several usecases: YES!

When looking into fair comparisons / benchmarks of relational and graph databases
where each one is optimized by using indexes,
you are able to even find performance benefits for relational databases in several graph like uses-cases because they take much more advantage from indexes than graph DBs do.

Example: Performance of Graph and Relational Databases in Complex Queries https://www.mdpi.com/2076-3417/12/13/6490

And Pinot already proofed being pretty strong on benefitting from indexes...

@hpvd hpvd changed the title Support for recursive queries (graph / tree like) Support for recursive queries (for graph / tree use-cases) Nov 30, 2024
@hpvd
Copy link
Author

hpvd commented Dec 3, 2024

from strategic USP POV: being able to efficiently use Pinot for production graph use-cases, may give a new unique solution, hardly to match in this combination by "real" graph DBs:

  • low-latency (P95/99)
  • high throughput
  • data freshness at scale (real time ingest)
  • pure size
  • storage efficiency
  • benefits of no need for a dedicated graph db as discussed above

would be also a great extension to anomaly detection (third eye)...

@hpvd
Copy link
Author

hpvd commented Dec 3, 2024

on the long run, one could also look into integrating approaches like RelGo (kind of Calcite extension) to make even "Property Graph Queries" (PGQ) possible in highly efficient manner (>10x)
(PGQs are now part of ISO SQL:2023 -> part 16 SQL/PGQ)

for RelGo approach, including benchmarks see:
Towards a Converged Relational-Graph Optimization Framework https://arxiv.org/html/2408.13480v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants