On Fri, Feb 7, 2025 at 12:09 PM Tomas Vondra <to...@vondra.me> wrote: > ... > Yes, I think that's pretty much the idea. Except that I don't think we > need to look at the |F| at all - it will have more impact for small |F|, > of course, but it doesn't hurt for large |F|. > > I think it'll probably need to consider which joins increase/decrease > the cardinality, and "inject" the dimension joins in between those.
YMMV, but I suspect you may find it much easier to look at |F|, |F JOIN D1|, |(F JOIN D1) JOIN D2|, etc., than to consider |F JOIN D1| / |F|, etc. (In other words, I suspect that considering absolute cardinalities will end up easier/cleaner than considering ratios of increases/decreases in cardinalities.) But I have not thought about this much, so I am not putting too much weight on my suspicions. James