What's a good way to develop a mental model about what's happening under the hood in EdgeDB?
With SQL, I have a mental model of how things work under the hood. For instance, I think of each table as being stored separately on disk, containing "rows". And the rows are really just equally-sized data blocks that are laid out back to back. B+ trees, with leaf nodes that point to (or just are) the rows, are used for indexes. When I'm designing SQL schemas, I use this mental model to make guesses about performance. And when my queries are slow, I look at the execution plan. My question is, how can I develop a similar intuition about EdgeDB? Under the hood, how are types and links stored in Postgres? And if I'm having performance issues, can I see an execution plan?
I'm wondering about the physical level—or at least how the EdgeDB conceptual level is translated to the Postgres conceptual level. The docs, and the comment you linked to, have helped me get pretty clear about the EdgeDB conceptual level.
* Every edgedb type has a postgres table * "single" properties and links are stored as columns in that table (links as the uuid of the target) * "multi" properties/links are stored as a link table So it's basically just translated to a relational database in normal form
Comments (323) 88 threads
Show all comments
Showing thread 5 of 88
With SQL, I have a mental model of how things work under the hood. For instance, I think of each table as being stored separately on disk, containing "rows". And the rows are really just equally-sized data blocks that are laid out back to back. B+ trees, with leaf nodes that point to (or just are) the rows, are used for indexes.
When I'm designing SQL schemas, I use this mental model to make guesses about performance. And when my queries are slow, I look at the execution plan.
My question is, how can I develop a similar intuition about EdgeDB? Under the hood, how are types and links stored in Postgres? And if I'm having performance issues, can I see an execution plan?
At the physical schema level [0] or at the conceptual schema level [1]?
This answer from edgedb CTO might clear the latter up; https://news.ycombinator.com/item?id=30291538
As for the former, I guess it is the same as however Postgres (pg) chooses to represent the edge-db tables. EdgeDB (graph on pg) sounds like Timescale (timeseries on pg [2]).
[0] https://en.wikipedia.org/wiki/Physical_schema
[1] https://en.wikipedia.org/wiki/Conceptual_schema
[2] https://blog.timescale.com/blog/timescaledb-vs-influxdb-for-...
* Every edgedb type has a postgres table
* "single" properties and links are stored as columns in that table (links as the uuid of the target)
* "multi" properties/links are stored as a link table
So it's basically just translated to a relational database in normal form
Continue this thread — 5 replies