2 ms·
I tried it against SQLite. I got ChatGPT to write me a script that would insert 1m edges and 1m nodes: https://gist.github.com/simonw/c16ce01244760e186a3a0aa3f
by simonw 4y ago
I tried it against SQLite. I got ChatGPT to write me a script that would insert 1m edges and 1m nodes:
https://gist.github.com/simonw/c16ce01244760e186a3a0aa3fee0405d https://gist.github.com/simonw/c16ce01244760e186a3a0aa3fee04...
Then I ran that query again and it seems to return results in about 80ms:
https://lite.datasette.io/?sql=https://gist.github.com/simonw/c16ce01244760e186a3a0aa3fee0405d#/data?sql=WITH+RECURSIVE+friend_of_friend+AS+%28%0A++SELECT+edges.next_node%0A++FROM+edges%0A++WHERE+edges.previous_node+%3D+14%0A++UNION%0A++SELECT+edges.next_node%0A++FROM+edges%0A++JOIN+friend_of_friend+ON+edges.previous_node+%3D+friend_of_friend.next_node%0A%29%0ASELECT+nodes.data%0AFROM+nodes%0AJOIN+friend_of_friend+ON+nodes.id+%3D+friend_of_friend.next_node%3B https://lite.datasette.io/?sql=https://gist.github.com/simon...
- eurasiantiger 4y agoNot very realistic example, you need to be requesting some actual fields across nodes and doing some filtering on at least strings and dates, maybe geo areas as well.
- simonw 4y agoGo ahead and try it! I've documented all of the tools you need to run some detailed experiments against SQLite entirely in your browser here.