kgyrtkirk commented on PR #17406:
URL: https://github.com/apache/druid/pull/17406#issuecomment-2478809445

   I was looking into this a bit and here is what I've found:
   * there is an unexpected overwrite of previous hints; if the same key is 
used:
   ```
   HintStrategyTable.builder()
     .hintStrategy(key1, ...)
     .hintStrategy(key1, ...);
   ```
   ...this is just unfortunate - I think it was unexpected
   * I don't see a way to attach hints to the tablescan/join nodes w/o 
modifying the parser...
   * exposing the aliases to be accessible during the predicate matching also 
seems near impossible: as the hints are propagate to the reltree at the end - 
which had already erased all details about originating names
   
   based on the above and some ideas during debugging I came with some ideas 
around:
   * set hints only on `TableScan` -s as `broadcast` / `sort_merge` with some 
priority
   * for a `join` the selected algo is the one with the maximal priority 
beneath its right branch
   * in general I think people want to only specify it for some table
   
   ex:
   ```
   select /*+ broadcast(wikipedia,2), sort_merge(foo,1) */
     from wikipedia w2 join (select * from wikipedia w1 join foo) a
   ```
   
   maybe we could start with an even simpler model and just introduce just 
introduce `brodacast(tableName)` and `sort_merge(tableName)`?
   and add heuristics like:
   * `broadcast` is selected if all right hand side sources are set to be 
broadcast
   * a single `sort_merge` forces `sort_merge` regardless what other table's 
hints
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to