Open joocer opened 9 months ago
a simpler example:
SELECT * FROM $planets, $satellites WHERE mass = gm
creates this plan:
└─ FILTER (mass = gm)
└─ CROSS JOIN
├─ READ ($planets) [id, name, mass, diameter, density, gravity, escapeVelocity, rotationPeriod, lengthOfDay, distanceFromSun, perihelion, aphelion, orbitalPeriod, orbitalVelocity, orbitalInclination, orbitalEccentricity, obliquityToOrbit, meanTemperature, surfacePressure, numberOfMoons]
└─ READ ($satellites) [id, planetId, name, gm, radius, density, magnitude, albedo]
TPCH query 08
pre-optimization
post optimization
the optimizer has pushed the projections to the SCANs, but has not pushed the predicates into the JOIN, maybe because it's a 6-way cross join.
Note this query ultimately fails after running for a few minutes because of the YEAR function call not handling null entries.