Hi Yiyun, The first requirement is that you will need to make some table cardinality estimates available to the query planner (eg. via RelMetadataQuery.getRowCount()). This will allow you to implement some threshold for deciding when to use the described join algorithm. The algorithm is known as "bind join". Some details can be found here: https://www.vldb.org/conf/1997/P276.PDF
Hope this helps. Jess On Sun, Aug 14, 2022 at 11:00 PM Yiyun Yin <[email protected]> wrote: > Dear, > Hello, I am Yiyun Yin. I am trying to develop a data federation query > service using calcite, and I have a question I would like to ask. > <https://stackoverflow.com/posts/73352781/timeline> > > When I use join query with calcite, how can I optimize the query plan > so that it can query the small table first, and then use the result of the > small table as the filter condition of the large table? > > I am looking forward for your answers. Thank you. > > > Best Regards, > Yours sincerely, > Yiyun Yin >
