← concepts · the commons
query tree
5 moment(s) that assert this concept — showing 1–5 of 5
single sourceRests on a single channel — treat as a lead, verify independently
↣ how this spread over time →PGCon · youtube · en
1Semantic optimization applies logical transformations to the query tree that preserve its semantic equivalence.
“these are transformations that you can make to the query tree that are logical based only on the sequel query itself and it has to be a you have to create the transformation you do has to result in a semantically equivalent tree”
spoken · 131s · 2019-06-10
PGCon · youtube · en
2Constant folding is a classic example of semantic optimization where expressions are evaluated at compile time and replaced with their results.
“constant folding is one classic example of this you can evaluate a function and then replace it with the result of that evaluation or an evaluate an expression rather”
spoken · 147s · 2019-06-10
PGCon · youtube · en
3Query optimization should not inhibit downstream optimizations, particularly by affecting optimization order.
“does it inhibit downstream optimization so this kind of for me breaks up into three parts or sort of different components and the first is that optimization order matters so there's a bunch of comments in the code and planard see a lot of them that talk about different pre-processing steps and why it matters if you do one before another”
spoken · 305s · 2019-06-10
PGCon · youtube · en
4Query optimization must not introduce implementation-specific expectations that lead to inconsistencies in query or plan trees.
“I've been looking back to 2014 and since what I've noticed is that one of the most common reasons for returning or rejecting patches it has to do with expectations at different parts of the code have the number of also it's a big source of bugs but number of columns one was supposed to be there and it was removed or the group I was supposed to be like this or the range table was supposed to be aligned with the target list and this or that way so a lot of these sort of expectations that are implementation-specific about the query tree and then eventually the plan tree are important to think about but are less cool”
spoken · 434s · 2019-06-10
PGCon · youtube · en
5To optimize a query with a provably false condition, one should first characterize the query and isolate the part most impacting the undesired behavior.
“the first thing I do is characterize the query so this is just getting a minimal repo that's all that this but basically what is the part of the query that's most important is most impacting the thing that we don't want”
spoken · 664s · 2019-06-10