Fork me on GitHub
#pathom
<
2022-10-17
>
Eric Dvorsak09:10:08

I have a query that the planner resolve correctly but inneficiently. Instead of using an id-resolver + alias it starts with a longer path which results in a few queries instead of one one the db. Is there a way to understand why the planner decided to take the long path to resolve an attribute and to force it to take the short path?

Eric Dvorsak10:10:33

thanks, didn't know about priorities, the issue here though is that both chains are starting with the same resolver

wilkerlucio00:10:38

hello Eric, yes, you right, without the weight tracker, Pathom by default will only try to prioritize via explicit declarations, but I see the point in your case, when some options start the same, kinda makes sense that the smaller should go first

wilkerlucio00:10:10

that said, are you using latest pathom version? and have you tried turning on the experimental path optimizations? I think in your case there, if you turn them on, you might not have these duplicated subpaths

wilkerlucio00:10:24

please let me know if you have a chance to try it, wonder if will affect your planning tree

wilkerlucio00:10:03

(to enable experimental optimizations, add to your env: :com.wsscode.pathom3.connect.planner/experimental-branch-optimizations true)

Eric Dvorsak07:10:20

@U066U8JQJ this is with both optim and weight plugin (graph and chosen path are the same without optim)

Eric Dvorsak07:10:11

optim alone is taking a longer path (and the graph is exactly the same as no optim/no weight plugin)

mbjarland13:10:47

so I ran into this s.o. question and feel quite inadequate with my answer. Figured somebody here would know what ::provides actually does and could provide a better answer .

Eric Dvorsak14:10:28

looking at the source provides is the output converted by a function called query->shape-descriptor which Convert pathom output format into shape descriptor format

Eric Dvorsak14:10:49

`Shape descriptor is a format to describe data. This format optimizes for fast detection of value present given a shape and a value path.`

mbjarland15:10:48

Ok - guess I feel somewhat better then. That's not too far from the comment I made on that s.o. question. Thank you for the check!

wilkerlucio00:10:35

yeah, all good, just add my entry there, hope it can still helps 🙂