3 ms·
I've always thought of it as closer to an optimizing JIT compiler than just a regular translation of instructions to instructions.
by VWWHFSfQ 4y ago
I've always thought of it as closer to an optimizing JIT compiler than just a regular translation of instructions to instructions.
- koolba 4y agoNot quite. A query plan is usually represented as a tree of steps to output the desired result. Each node would be a high level operation (e.g. a sort) or source of data (e.g. read rows from table), possibly pulling from other nodes beneath it. The actual compilation of the plan to machine code is possible and a few database systems do exactly that. But most process then nodes themselves or JIT specific node types represent simpler or more tightly defined operations.
- kaba0 4y agoI think they meant it in a more abstract sense; also see relevant sister threads.
- WJW 4y agoDon't most planners also take table and/or index statistics into account? AFAIK for most of the commonly used DBMSes, the same query will result in radically different query plans if the table contents are different enough.