prestodb / rfcs

Presto RFCs
Apache License 2.0
0 stars 22 forks source link

Grammar for plan constraints #20

Open aaneja opened 3 months ago

aaneja commented 3 months ago

This RFC describes the grammar we would use for specifying plan constraints

aaneja commented 3 months ago

With #3fcc611 I've update the grammar to make the join specification more explicit.

This disallows specifying grouped relations like (A B C) . Instead we need to specify the full join order like ((A B) C). This will make specifying ambiguous group relations like (A LOJ B ROJ C) impossible

At a later stage, we can enhance the grammar so that inner-join-groups like (A B C) can also be specified - this would be useful to constrain the optimizer to reorder the nodes in it separately from the rest of the join graph

kaikalur commented 2 months ago

A high level comment - plan level hints make them not accessible to most users. We should keep them more high level like:

BROADCAST
MAPJOIN
HIGHDISTINCT
LOWDISTINCT 
RANDOM_SHUFFLE
FORCE_SHUFFLE
SHARDING
PAYLOAD
SALTING
...

that tell the planner something about the data shape. Planner is a not concept that most users understand. But some of the others we can easily explain to users. Also things fragments can change based on other options. So not sure it's good to use those.