On 03/14/2017 07:31 PM, Andres Freund wrote:
On 2017-03-14 16:58:54 +0200, Heikki Linnakangas wrote:
* How tight are we on space in the ExprEvalStep union? Currently, the
jump-threading preparation replaces the opcodes with the goto labels, but it
would be really nice to keep the original opcodes, for debugging purposes if
There's nothing left to spare :(. For debugging I've just used
ExecEvalStepOp() - it's inconvenient to directly print the struct
anyway, since gdb prints the whole union...
This comment above the union is not accurate:
* Data for an operation. Inline stored data is faster to access, but
* bloats the size of all instructions. The union should be kept below
* bytes (so the entire struct is below 64bytes, a single cacheline on
* common systems).
On my x86-64 system, the whole struct is 64 bytes, but the union is only
40 bytes. The fields before the union occupy 24 bytes. IOW, the union
should be kept below 40 bytes, not 48.
Hmm. Could we make the instructions variable size? It would allow
packing the small instructions even more tight, and we wouldn't need to
obsess over a particular maximum size for more complicated instructions.
A compromise might be to have the fixed size, but have "continuation"
opcodes for the more complicated instructions. An XmlExpr instruction,
for example, could have an extra instruction after the primary one, just
to hold more fields. When evaluating it, we would just increment the
Program Counter by two instead of one, to skip over the extra instruction.
For reference, here are the sizes of all the structs in the union:
Sent via pgsql-hackers mailing list (firstname.lastname@example.org)
To make changes to your subscription: