3 ms·
Following a Select Statement Through Postgres Internals
- jaytaylor 11y agoThis article superbly bridges the (usually very large) gap between Database-Theory and Databases-in-Reality. It'd also be interesting to learn about how MySQL and Postgres differ in terms of how they process queries internally. I'm sure there'd be interesting tradeoffs all over the place.
- aidos 11y agoI really enjoyed that. The Postgres docs have a really great overview of this stuff too. I started reading it one evening and ended up going through it all because it's so interesting and presented in a really approachable way. http://www.postgresql.org/docs/9.4/static/overview.html http://www.postgresql.org/docs/9.4/static/overview.html
- Animats 11y agoAw, just when it was getting good, it cuts off for the next episode, where the table has an index. This episode only covers what happens with no index. It gets really interesting when the query involves multiple tables and indices, and the query optimizer has a choice of strategies. You don't really get the benefits of a full SQL query engine until you ask it to do something hard.
- softblush 11y agoThis was already blogged elsewhere last year. Part 1) http://patshaughnessy.net/2014/10/13/following-a-select-statement-through-postgres-internals http://patshaughnessy.net/2014/10/13/following-a-select-stat... and Part 2) http://patshaughnessy.net/2014/11/11/discovering-the-computer-science-behind-postgres-indexes http://patshaughnessy.net/2014/11/11/discovering-the-compute...
- mozumder 11y agoIf someone were to do a C-based API server, does Postgres have an API to interface with it at the PLAN or EXECUTE level, to save from long query processing? Say, a query with dozens of joins and columns, and you want to shave off 500 microseconds? Libpq doesn't seem to have something like that.
- anarazel 11y agoWhat you describe sounds like prepared statements. PQprepare/PQexecPrepared would be the relevant libpq functions.