kasei / attean

A Perl Semantic Web Framework
19 stars 10 forks source link

Refactor join plans base cost #71

Open kjetilk opened 8 years ago

kjetilk commented 8 years ago

I have had to replicate the code that estimates the cost of hash and nested loop joins in two places now: https://github.com/kjetilk/p5-atteanx-query-cache/blob/try-recurse-plan-with-access-plan/lib/AtteanX/Model/SPARQLCache.pm#L54 https://github.com/kjetilk/p5-atteanx-query-cache/blob/try-recurse-plan-with-access-plan/lib/AtteanX/Model/SPARQLCache/LDF.pm#L58

I don't know if I could do it any better with the existing code, other than hack the planner instead. So, perhaps there could be some other way to do it in Attean, so that I can just call a method when I need this?

If I call $planner->cost_for_plan($plan, $self) in the model itself, it will obviously result in a infinite loop (I've tried :-) ), but perhaps some other method on the planner?